solrsolrjsolr4solrconfig

queryResultWindowSize in Solr Pagination


I understand what is queryResultWindowSize and queryResultMaxDocsCached.

query 1 -> q=car&rows=10&start=0

query 2 -> q=car&rows=10&start=10

(Assume query 1 and 2 are continuous queries by user1)

query 3 -> q=boat&rows=10&start=0

query 4 -> q=car&rows=10&start=10

(Assume query 3 and 4 are continuous queries by user2)

my queryResultWindowSize = 20 and queryResultMaxDocsCached = 20. When query1 is issued by user 20 docs will be cached. So the next 10 paginated docs are ready in cache. Will the cache expires if user2 issues the query3 ? or the cache is meant for individual queries ? Does solr do a cache for query1 and query3 separately ?


Solution

  • The caches are pr. query. In general, it will match the query performed and use that to look up for the correct cache, and then return the values from that cache. That means that query1 and query3 will be cached separately (otherwise Solr would only be able to cache the most recent query, and that wouldn't be very helpful in most production settings).