-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Add search_after parameter to new terms_enum api #72910
Comments
Pinging @elastic/es-search (Team:Search) |
I'm not sure if this is viable - I coded up an implementation but was hitting UnsupportedOperationExceptions using search_after on a
The seekCeil operation is not always handled in TermsEnum implementations and the keyword field's use of We only suggested offering this API because we thought it was cheap/simple to do but based on this experience I'm not sure we should offer it. |
The IntersectTermsEnum takes the
|
We've had discussions on a general approach to support paging in our REST APIs: #64099. I wonder if this aligns with what we're been planning for other APIs, maybe we're standardizing on using |
…s returning a TermsEnum implementation that supports seekCeil() but we fell at the first hurdle with the keyword field not working - UnsupportedOperationException. See elastic#72910 for discussion.
Adds an optional parameter to the _terms_enum request designed to allow paging. The last term from a previous result can be passed as the search_after parameter to a subsequent request, meaning only terms after the given term (but still matching the provided string prefix) are returned Relates to #72910
Backport of ebb113a Adds an optional parameter to the _terms_enum request designed to allow paging. The last term from a previous result can be passed as the search_after parameter to a subsequent request, meaning only terms after the given term (but still matching the provided string prefix) are returned Relates to #72910
Thanks @jtibshirani We haven't really settled on an approach for user interface on the other issue. I have a separate document about search API key metadata where I also talked about pagination. The basic idea is to have a more generic parameter, I call it
Personally I feel it's easier for users to consume our APIs if they provide consistent interfaces for simliar concept, e.g. pagination, instead of similar unerlying implementations. @albertzaharovits also suggested we could have this |
I too would like to not have our generic pagination named Another choice is whether |
@jtibshirani provided input through another channel that she prefers |
In the interests of maximum performance, the terms_enum API doesn't support anything other than the sort order used internally to arrange terms in the index |
Closed in #72933 |
To allow client applications to page through many autocomplete suggestions we should offer a
search_after
parameter. Calling applications would pass the last term value from the previous set of results and the returned results would be all those matching the provided prefixstring
param but after the suppliedsearch_after
parameter. An example might be:Request 1
Result 1
Request 2 (with new search_after param)
Result 2
It would be a client error to pass a
search_after
string that does not start with the providedstring
prefix.Example invalid request that would produce an error
Related to #71550
The text was updated successfully, but these errors were encountered: