jpountz commented on PR #13711: URL: https://github.com/apache/lucene/pull/13711#issuecomment-2327425891
Sorry, I don't think we should make Lucene's `Weight` implementations public. I looked up the OpenSearch issue, if I understand correctly, the problem you're trying to solve is that it's wasteful for `PointRangeQuery` to evaluate the whole range when it's only asked for the first 10 doc IDs that match the range query. I agree it's wasteful. We have the same problem on nightly benchmarks and the IntNRQ task. I wonder if there are better ways to do what you're after, e.g. adding a `TopDocs Weight#topk(int n, int totalHitsThreshold)` API that would default to collecting hits, and that some classes such as `PointRangeQuery` could override. As I'm writing this, I'm not convinced that it's actually a good idea. Using sparse indexing would likely be a better approach, especially if the index can be sorted, as this would produce good iterators that don't have this huge up-front cost of evaluating the query against the entire segment. -- 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