-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
Describe the bug
Description
We override IndexSearcher#search(List<LeafReaderContext> leaves, Weight weight, Collector collector) and it contains the logic to apply time series desc optimisation for scanning segments in reverse for descending sort use-cases.
Existing Lucene 9.12.1 and OS 2.19 call flow
Lucene 10.1.0 and OS 3.0 call flow
With Lucene 10 changes, the new replacement method
search(LeafReaderContextPartition[] partitions, Weight weight, Collector collector)
only gets invoked via IndexSearcher#search(Query, CollecterManager) which is not used by OpenSearch in QueryPhase#searchWithCollector.
So, it was never getting called causing the time series desc optimization to be skipped.
My changes ensure it will be called in the same way that IndexSearcher does for CollectorManager variant.
Related Issues
PR for the fix #17329
Related component
Search:Performance
To Reproduce
Execute asc_sort_timestamp and compare the latency it will be slower with OS 3.0 compared to OS 2.19
Expected behavior
Time Series Desc Optimisation should be invoked for sort queries.
Additional Details
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Status

