-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
max_children exist only in top level nested sort #46731
max_children exist only in top level nested sort #46731
Conversation
Pinging @elastic/es-search |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch @erayarslan , I left a minor comment but the change looks good.
server/src/test/java/org/elasticsearch/search/sort/FieldSortIT.java
Outdated
Show resolved
Hide resolved
2a8ad79
to
46cb29b
Compare
Thanks @jimczi , I updated integration test. Can you please take a look? |
@elasticmachine test this please |
46cb29b
to
61370d0
Compare
CI failed. I think my branch outdated. Now, its okay. |
@elasticmachine test this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @erayarslan
This commit restricts the usage of max_children to the top level nested sort since it is ignored on the other levels.
thank you for your time @jimczi |
FIX
related with (#33587 (comment))
If we have query like that;
Elastic going to ignore max_children=1, cause we passed top level nested sort object in here (example flow);
elasticsearch/server/src/main/java/org/elasticsearch/search/sort/FieldSortBuilder.java
Lines 334 to 340 in 3f18cf7
elasticsearch/server/src/main/java/org/elasticsearch/search/sort/SortBuilder.java
Lines 173 to 186 in 3f18cf7
elasticsearch/server/src/main/java/org/elasticsearch/index/fielddata/fieldcomparator/FloatValuesComparatorSource.java
Lines 69 to 74 in 3f18cf7
So i think we must use max_children on top level nested sort or we need to pass last level nested sort.
In this PR, I allow to max_children on top level nested sort.