-
Notifications
You must be signed in to change notification settings - Fork 25k
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
PIT and search_after do not return all "pages" of a query when nested type field is in mapping #100260
Comments
Pinging @elastic/es-search (Team:Search) |
I believe this is no longer an issue. I ran the steps to reproduce and the second query returned 5 results instead of one, a third query returned 4 results. I ran the query specified by this step:
and 5 results were returned instead of one:
I then ran the following query using the
This gave me the final expected 4 results:
So this issue appears to have been resolved. |
This indeed works just fine in 8.14+ I am unsure when it was fixed. but it is. |
Elasticsearch Version
main
Installed Plugins
No response
Java Version
bundled
OS Version
W
Problem Description
This problem was discovered while investigating an ES SQL CI failure here. I have tested this behavior outside ES SQL and I narrowed it down to a more simpler scenario.
Steps to Reproduce
Create a
test_emp
index with the following mapping:Add the following data set to it:
POST /test_emp/_bulk
Open a PIT against this index:
POST /test_emp/_pit?keep_alive=5m
and use the provided pit id in the following query. Notice thesize
is set to 5.POST /_search
This is the first "page" of results:
Use the last document
sort
content in the next query assearch_after
:The results now return one document only:
But, if I open a new PIT and change the original query to use
"size": 15
:I get back 14 documents:
This shows that the original query using
"size": 5
terminates early.Testing different scenarios I've came to the conclusion that the simple presence of
dep
field asnested
in the mapping (there are no documents having values fordep
in my tests) makes the query to return incorrect results. If the tests are performed without this field in the mapping, all 3 pages of results are returned correctly (5 documents 1st page, 5 documents 2nd page, 4 documents 3rd and last page).Logs (if relevant)
No response
The text was updated successfully, but these errors were encountered: