jpountz commented on issue #15139: URL: https://github.com/apache/lucene/issues/15139#issuecomment-3242205902
It took me some time to understand your point @romseygeek but I think I have it now so I'll explain it again in different terms so that you can check if I got it right. When sorting by field, Lucene dynamically filters competitive hits via `LeafCollector#competitiveIterator`. However, it only does so with the first sort field. So if you have a secondary sort field and your first sort field has lots of ties, then the filtering won't be super efficient. In contrast, if Lucene could somehow detect that there is a filter on the first sort field (so that all matching docs will have the same value) then it could let the secondary sort field do the filtering. Assuming that I got it right, then this is an optimization that would make sense regardless of how the index is sorted? (It would just happen to be more efficient if the index is sorted) Maybe this belongs to a different issue, we somehow need to make Lucene's `Sort` objects aware of the filters that are applied to the query? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
