You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Tom Burton-West <tb...@umich.edu> on 2014/09/23 18:48:30 UTC

queryResultMaxDocsCached vs queryResultWindowSize

Hello,

queryResultWindowSize sets the number of documents   to cache for each
query in the queryResult cache.    So if you normally output 10 results per
pages, and users don't go beyond page 3 of results, you could set
queryResultWindowSize to 30 and the second and third page requests will
read from cache, not from disk.  This is well documented in both the Solr
example solrconfig.xml file and the Solr documentation.

However, the example in solrconfig.xml and the documentation in the
reference manual for Solr 4.10 say that queryResultMaxDocsCached :

"sets the maximum number of documents to cache for any entry in the
queryResultCache".

If this were true, then it would seem that this parameter duplicates
queryResultWindowSize.

Looking at the code  it appears that the queryResultMaxDocsCached parameter
actually tells Solr not to cache any results list that has a size  over
 queryResultMaxDocsCached:.

From:  SolrIndexSearcher.getDocListC
// lastly, put the superset in the cache if the size is less than or equal
    // to queryResultMaxDocsCached
    if (key != null && superset.size() <= queryResultMaxDocsCached &&
!qr.isPartialResults()) {
      queryResultCache.put(key, superset);
    }

Deciding whether or not to cache a DocList if its size is over N (where N =
queryResultMaxDocsCached) is very different than caching only N items from
the DocList which is what the current documentation (and the variable name)
implies.

Looking at the JIRA issue https://issues.apache.org/jira/browse/SOLR-291
the original intent was to control memory use and the variable name
originally suggested was  "noCacheIfLarger"

Can someone please let me know if it is true that the
queryResultMaxDocsCached parameter actually tells Solr not to cache any
results list that contains over the  queryResultMaxDocsCached?

If so, I will add a comment to the Cwiki doc and open a JIRA and submit a
patch to the example file.

Tom


.



---------------------------

http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_10/solr/example/solr/collection1/conf/solrconfig.xml?revision=1624269&view=markup

635     <!-- Maximum number of documents to cache for any entry in the
636 queryResultCache.
637 -->
638 <queryResultMaxDocsCached>200</queryResultMaxDocsCached>