-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Pre-sort shards based on the max/min value of the primary sort field #49092
Commits on Nov 14, 2019
-
Pre-sort shards based on the max/min value of the primary sort field
This change automatically pre-sort search shards on search requests that use a primary sort based on the value of a field. When possible, the can_match phase will extract the min/max (depending on the provided sort order) values of each shard and use it to pre-sort the shards prior to running the subsequent phases. This feature can be useful to ensure that shards that contain recent data are executed first so that intermediate merge have more chance to contain contiguous data (think of date_histogram for instance) but it could also be used in a follow up to early terminate sorted top-hits queries that don't require the total hit count. The latter could significantly speed up the retrieval of the most/least recent documents from time-based indices. I took two shortcuts here: * I reused the can_match phase to add the required information for the shard sort. We could instead introduce a new phase but it make sense to me to use the existing phase to add more informations as long as the additional ops are lightweight. * The shard sort is done automatically if the primary search sort is based on a field. However this sorting only makes sense if the range of values in each shard doesn't overlap (time-based indices sorted on timestamp for instance). We could add a new option to enable/disable this behavior or even add an additional `shard_sort` criteria but I also like the fact that users don't need to set any option to benefit from this feature. Relates elastic#49091
Configuration menu - View commit details
-
Copy full SHA for 5f91d33 - Browse repository at this point
Copy the full SHA 5f91d33View commit details -
Configuration menu - View commit details
-
Copy full SHA for 125b6e2 - Browse repository at this point
Copy the full SHA 125b6e2View commit details
Commits on Nov 15, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 66f1852 - Browse repository at this point
Copy the full SHA 66f1852View commit details
Commits on Nov 20, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 9f959dc - Browse repository at this point
Copy the full SHA 9f959dcView commit details -
Configuration menu - View commit details
-
Copy full SHA for a7e61c2 - Browse repository at this point
Copy the full SHA a7e61c2View commit details -
Configuration menu - View commit details
-
Copy full SHA for f41a8f4 - Browse repository at this point
Copy the full SHA f41a8f4View commit details -
Update server/src/main/java/org/elasticsearch/action/search/CanMatchP…
…reFilterSearchPhase.java Co-Authored-By: Adrien Grand <jpountz@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 4baaf13 - Browse repository at this point
Copy the full SHA 4baaf13View commit details -
Update server/src/main/java/org/elasticsearch/action/search/CanMatchP…
…reFilterSearchPhase.java Co-Authored-By: Adrien Grand <jpountz@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 39f7e47 - Browse repository at this point
Copy the full SHA 39f7e47View commit details -
Update server/src/main/java/org/elasticsearch/action/search/CanMatchP…
…reFilterSearchPhase.java Co-Authored-By: Adrien Grand <jpountz@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 56195eb - Browse repository at this point
Copy the full SHA 56195ebView commit details -
Update server/src/main/java/org/elasticsearch/action/search/CanMatchP…
…reFilterSearchPhase.java Co-Authored-By: Adrien Grand <jpountz@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 4977d3f - Browse repository at this point
Copy the full SHA 4977d3fView commit details -
Update server/src/main/java/org/elasticsearch/cluster/routing/GroupSh…
…ardsIterator.java Co-Authored-By: Adrien Grand <jpountz@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 3cc99a4 - Browse repository at this point
Copy the full SHA 3cc99a4View commit details -
Update server/src/main/java/org/elasticsearch/search/sort/MinAndMax.java
Co-Authored-By: Adrien Grand <jpountz@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for aa517ff - Browse repository at this point
Copy the full SHA aa517ffView commit details
Commits on Nov 21, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 310b140 - Browse repository at this point
Copy the full SHA 310b140View commit details -
Configuration menu - View commit details
-
Copy full SHA for d89dfea - Browse repository at this point
Copy the full SHA d89dfeaView commit details