-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Improve scroll search by using Lucene's IndexSearcher#searchAfter(...) #4940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Is the idea to be able to |
This is already possible, the |
Hey, neat. That is kinda documented on the scroll page but it is implied that scroll is a scan thing. So this enhancement will make it more efficient to scroll without scan? |
Yes, this enhancement will make scroll without scan more efficient. The memory usage will be improved from |
…of regular search methods which rely on `from` for pagination. This prevents the creation of priority queues of `from + size`, instead the size of the priority queue will always be equal to `size`. Closes #4940
nice, thanks for this optimisation! |
Improve the regular scroll search by using Lucene's searchAfter, which allows subsequent scroll request to always have a priority queue size equal to the specified
size
in the first search request. (priority queue is used to collect the competitive hits that match with a query)Currently the priority queue size grows with each subsequent scroll request with what has been specified in
from
of the first search request.Note: scan scroll is unaffected by this issue, which already is a highly optimized search to fetch a large part or all docs from a cluster. Scan scroll forcefully sort the hits always by the Lucene docids, while with the regular scroll can now support any sort efficiently.
The text was updated successfully, but these errors were encountered: