Thanks for your help Yonik and Tomas, I had several mistaken assumptions about how caching worked which were resolved by walking through the code in the debugger after reading your replies.
Tom On Fri, Sep 26, 2014 at 4:55 PM, Yonik Seeley <yo...@heliosearch.com> wrote: > On Fri, Sep 26, 2014 at 4:38 PM, Tom Burton-West <tburt...@umich.edu> > wrote: > > Hi Yonik, > > > > I'm still confused. > > > > suspect don't understand how paging and caching interact. I probably > need > > to walk through the code. Is there a unit test that exercises > > SolrIndexSearcher.getDocListC or a good unit test to use as a base to > write > > one? > > > > > > Part of what confuses me is whether what gets cached always starts at > row 1 > > of results. > > Yes, we always cache from the first row. > Asking for rows 91-100 requires collecting 1-100 (and it's the latter > we cache - ignoring deep paging). > It's also just ids (and optionally scores) that are cached... so > either 4 bytes or 8 bytes per document cached, depending on if you ask > for scores back. > > queryWindowSize just rounds up the upper bound. > > > I'll try to explain my confusion. > > Using the defaults in the solrconfig example: > > <queryResultWindowSize>20</queryResultWindowSize> > > <queryResultMaxDocsCached>200</queryResultMaxDocsCached> > > > > If I query for start=0, rows =10 Solr fetches 20 results and caches > them. > > If I query for start =11 rows =10 Solr read rows 11-20 from cache > > Correct. > > > What happens when I query for start = 21 rows= 10? > > I thought that Solr would then fetch rows 21-40 into the > queryResultCache. > > Is this wrong? > > It will result in a cache miss and we'll collect 0-40 and cache that. > > > If I query for start =195 rows =10 does Solr cache rows 195-200 but go > to > > disk for rows over 200 (queryResultMaxDocsCached=200)? Or does Solr > skip > > caching altogether for rows over 200 > > Probably the latter... it's an edge case so I'd have to check the code > to know for sure if the check is pre or post rounding up. > > -Yonik > http://heliosearch.org - native code faceting, facet functions, > sub-facets, off-heap data > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org > For additional commands, e-mail: dev-h...@lucene.apache.org > >