DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations

Trending

  • Which Is Better for IoT: Azure RTOS or FreeRTOS?
  • Integration Testing Tutorial: A Comprehensive Guide With Examples And Best Practices
  • AI Technology Is Drastically Disrupting the Background Screening Industry
  • IntelliJ IDEA Switches to JetBrains YouTrack
  1. DZone
  2. Data Engineering
  3. Databases
  4. Solr Optimization – query result window size

Solr Optimization – query result window size

Rafał Kuć user avatar by
Rafał Kuć
·
Sep. 13, 11 · News
Like (0)
Save
Tweet
Share
7.89K Views

Join the DZone community and get the full member experience.

Join For Free

Hereby I would like to start a small series of articles describing the elements of the optimization of Solr instances. At first glance I decided to describe the parameter that specifies the data fetch window size – the query result window size. Hopefully, this article will explain how to use this parameter, how to modify and adapt it to your needs.

The begining

To start talking about this configuration parameter, we must first say how Solr fetches results from the index. When passing the rows parameter to Solr, with the value of 20 for example, we tell Solr that we want the result list to contain the maximum of 20 documents. However, the number of results, which was taken from the index varies and is determined precisely by the queryResultWindowSize parameter. This parameter, defined in the solrconfig.xml file, determines how many results will be retrieved from the index and stored in queryResultCache.

But what can I use queryResultWindowSize for ?

The queryResultWindowSize parameter specifies the size of so called results window, which is simply the number of documents that will be fetched from the index when retrieving search results.  For example, setting queryResultWinwdowSize to 100 and send the following query:

q=car&rows=30&start=10
 

will result in a maximum of 30 documents in the search result list, however Solr will fetch 100 documents from the index (starting at index 0 and ending at index 100) and then try Solr will place them in queryResultCache. The next query, which will differ only in the parameters start and rows can be retrieved from queryResultCache.

Configuration

To set the queryResultWindowSize to the value of 100, you must add the following entry to the solrconfig.xml file:

<queryResultWindowSize>100</queryResultWindowSize>
 

What to remember ?

Of course, setting only the queryResultsWindowSize is not everything. You should still provide adequate space in queryResultCache for Solr to be able to store the necessary information. However queryResultCache configuration is a topic for another article.

But why use it ?

The answer to that question is quite simple – if your application and your users often use the paging it is reasonable to consider changing the default value of the queryResultWindowSize. In most cases, where the implementation was based on paging, changing the value of this parameter caused a severe increase in performance when switching between query pages of the results.

Database optimization

Published at DZone with permission of Rafał Kuć, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Trending

  • Which Is Better for IoT: Azure RTOS or FreeRTOS?
  • Integration Testing Tutorial: A Comprehensive Guide With Examples And Best Practices
  • AI Technology Is Drastically Disrupting the Background Screening Industry
  • IntelliJ IDEA Switches to JetBrains YouTrack

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com

Let's be friends: