Hi, Actually sorting requires that you setup the whole query and all of its iterators. Sure, you could then do stepping over documents not in the cache, but the query has to be executed to actually do the sorting, you can just use the bitset to maybe quicker step forward. You can do this inside Solr: Take the filtercache bitset and apply it as FILTER clause to the main query and assign a good cost, so it leads the iteration. Then it will leap-frog jump over all documents not in the cache. But the actual speed benefit is neglectible du to added execution complexity.
I think Daniele Antuzi is not fully aware how queries and result collection work in Lucene, looks like a misunderstanding on how this differs from databases (databases first collect all results and then sort them like a big array of rows). If you understand that in Lucene all is iterator-based and the sorting works with a priority queue, you quickly understand that the filtercache does not really help for sorting because you need the query's iterators to calculate scores anyways. Uwe ----- Uwe Schindler Achterdiek 19, D-28357 Bremen https://www.thetaphi.de eMail: [email protected] > -----Original Message----- > From: Shawn Heisey <[email protected]> > Sent: Tuesday, January 4, 2022 5:21 AM > To: [email protected] > Subject: Re: [Solr] does not use the filterCache > > On 1/3/2022 5:00 PM, David Smiley wrote: > > The filter cache contains unsorted lists of docs; an entry ultimately > > needs to be sorted to what the user wants. The score in particular > > requires actually running the query, at which point there isn't a point > > in using the filter cache. Well sort of; I could imagine a hybrid to > > visit only the matching docs but that would add complexity. > > I know that a filter query does not affect the scores in search results. > Filters decide which docs in the query result will be > included/excluded in the final resultset, and do not influence the score. > > Thinking about that ... I can't imagine why sorting by score would > preclude using the filterCache. The scores come from the main query, > not the filters. But there is likely to be some aspect to Lucene > internals that I know nothing about -- my knowledge of those internals > is very limited. > > Thanks, > Shawn > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
