-
Notifications
You must be signed in to change notification settings - Fork 185
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
[FEATURE] add support for search(search_after) #337
Comments
I will try to work on this issue |
The OpenSearch library currently does not support the It would be possible that the OpenSearch library should support the One of the options may be switching to another search library that supports the search_after parameter, or implementing a different pagination strategy using the from and size parameters. It may also be possible to contribute to the OpenSearch library to add support for the |
As I understand, this issue may be considered as closed? @ReinGrad? |
FYI I've been able to use the # initial query
>>> query.to_dict()
{
"query": {
"match_all": {} # or whatever
},
"from": 0,
"size": 1,
"sort": [
"field1.keyword",
"field2.keyword"
]
}
# define search_after spec
>>> search_after_spec = [
"some_field1_value",
"some_field2_value"
]
# apply search_after spec to existing query
>>> query = query.extra(search_after=search_after_spec)
# query with search_after added
>>> query.to_dict()
{
"query": {
"match_all": {} # or whatever
},
"from": 0,
"size": 1,
"sort": [
"field1.keyword",
"field2.keyword"
],
"search_after": [
"some_field1_value",
"some_field2_value"
]
} FWIW, I've also been using this same |
If anyone wants to add this as a feature, I think it still makes sense. Or if anyone wants to update the user guide examples for now. |
@r-mendes or @morrissimo Any interest in picking this up? |
Also, is https://github.com/opensearch-project/opensearch-py/blob/d8dc5474b7e7e2b443d9858c21d8f7be93306704/guides/search.md?plain=1#L140C37-L140C49 not the way to do this, meaning we still need different support for it? |
I will look into this issue |
What is the bug?
The
search
method doesn't supportsearch_after
parameter.How can one reproduce the bug?
sort
parameter;hit
entry;hit
entry, fetch thesort
field value;search
passing the value fetched in step 4 in thesearh_after
parameter;What is the expected behavior?
The
search_after
parameter supposed to be supported in the most recent version of the library.What is your host/environment?
Linux, Ubuntu 22.04
Do you have any screenshots?
Do you have any additional context?
The lack of this parameter block the usage of queries' pagination using the
search_after
andPoint-in-time
approach.The text was updated successfully, but these errors were encountered: