-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Fix scroll query with a sort that is a prefix of the index sort #27498
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
During a scroll, if the search sort matches the index sort we use the sort values of the last doc returned by the previous scroll to optimize the main query with a `SearchAfterSortedDocQuery`. This query can "jump" directly to the first document that sorts after the provided sort values. This optim is also applied if the search sort is a prefix of the index sort but this case throws an exception because we use the index sort (instead of the search sort) to validate the sort values of the last document. This change fixes this bug and adds a test for it.
jpountz
approved these changes
Nov 24, 2017
jimczi
added a commit
that referenced
this pull request
Nov 24, 2017
During a scroll, if the search sort matches the index sort we use the sort values of the last doc returned by the previous scroll to optimize the main query with a `SearchAfterSortedDocQuery`. This query can "jump" directly to the first document that sorts after the provided sort values. This optim is also applied if the search sort is a prefix of the index sort but this case throws an exception because we use the index sort (instead of the search sort) to validate the sort values of the last document. This change fixes this bug and adds a test for it.
jimczi
added a commit
that referenced
this pull request
Nov 24, 2017
During a scroll, if the search sort matches the index sort we use the sort values of the last doc returned by the previous scroll to optimize the main query with a `SearchAfterSortedDocQuery`. This query can "jump" directly to the first document that sorts after the provided sort values. This optim is also applied if the search sort is a prefix of the index sort but this case throws an exception because we use the index sort (instead of the search sort) to validate the sort values of the last document. This change fixes this bug and adds a test for it.
martijnvg
added a commit
that referenced
this pull request
Nov 24, 2017
* es/master: (38 commits) Backport wait_for_initialiazing_shards to cluster health API Carry over version map size to prevent excessive resizing (#27516) Fix scroll query with a sort that is a prefix of the index sort (#27498) Delete shard store files before restoring a snapshot (#27476) Replace `delimited_payload_filter` by `delimited_payload` (#26625) CURRENT should not be a -SNAPSHOT version if build.snapshot is false (#27512) Fix merging of _meta field (#27352) Remove unused method (#27508) unmuted test, this has been fixed by #27397 Consolidate version numbering semantics (#27397) Add wait_for_no_initializing_shards to cluster health API (#27489) [TEST] use routing partition size based on the max routing shards of the second split Adjust CombinedDeletionPolicy for multiple commits (#27456) Update composite-aggregation.asciidoc Deprecate `levenstein` in favor of `levenshtein` (#27409) Automatically prepare indices for splitting (#27451) Validate `op_type` for `_create` (#27483) Minor ShapeBuilder cleanup muted test Decouple nio constructs from the tcp transport (#27484) ...
martijnvg
added a commit
that referenced
this pull request
Nov 24, 2017
* es/6.x: (30 commits) Add wait_for_no_initializing_shards to cluster health API (#27489) Carry over version map size to prevent excessive resizing (#27516) Fix scroll query with a sort that is a prefix of the index sort (#27498) Delete shard store files before restoring a snapshot (#27476) CURRENT should not be a -SNAPSHOT version if build.snapshot is false (#27512) Fix merging of _meta field (#27352) test: do not run percolator query builder bwc test against 5.x versions Remove unused method (#27508) Consolidate version numbering semantics (#27397) Adjust CombinedDeletionPolicy for multiple commits (#27456) Minor ShapeBuilder cleanup [GEO] Deprecate ShapeBuilders and decouple geojson parse logic Improve docs for split API in 6.1/6.x (#27504) test: use correct pre 6.0.0-alpha1 format Update composite-aggregation.asciidoc Deprecate `levenstein` in favor of `levenshtein` (#27409) Decouple nio constructs from the tcp transport (#27484) Bump version from 6.1 to 6.2 Fix whitespace in Security.java Tighten which classes can exit ...
clintongormley
added
:Search/Search
Search-related issues that do not fall into other categories
and removed
:Scroll
labels
Feb 14, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
>bug
:Search/Search
Search-related issues that do not fall into other categories
v6.1.0
v6.2.0
v7.0.0-beta1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
During a scroll, if the search sort matches the index sort we use the sort values of the last doc returned by
the previous scroll to optimize the main query with a
SearchAfterSortedDocQuery
.This query can "jump" directly to the first document that sorts after the provided sort values.
This optim is also applied if the search sort is a prefix of the index sort but this case throws an exception
because we use the index sort (instead of the search sort) to validate the sort values of the last document.
This change fixes this bug and adds a test for it.