romseygeek commented on issue #15139: URL: https://github.com/apache/lucene/issues/15139#issuecomment-3241252650
I've been thinking along similar lines, although my plan was to use a FilteredLeafReader to only expose the block of documents matching the primary sort. The advantage of doing this would be that we could also filter the Sort so that the secondary sort fields now look like primary sort fields. This would be particularly useful for range queries on secondary sort fields: let's say you have an index of logs sorted by `host` and then by `timestamp`. Doing range queries on the timestamp field can't make use of the fact that they are sorted at the moment, because at collection time the range query doesn't know that all the documents it sees are from a single host, so all the timestamp values will be in-order. If the range query got a filtered reader with an adjusted index sort, it would be able to stop collection once it sees a timestamp value outside its range. Another way of doing this could be to adjust the signature of `BulkScorer#scorer` to also take a `Sort` parameter. -- 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: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org