-
Notifications
You must be signed in to change notification settings - Fork 24.7k
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
Include release highlight for query rewrite #97178
Merged
elasticsearchmachine
merged 8 commits into
elastic:main
from
salvatore-campagna:fix/96161-skip-shards-release-highlight
Jun 28, 2023
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a2b54da
fix: include release highlight for query rewrite
salvatore-campagna a6fdc9f
fix: update release highlight title
salvatore-campagna 08a7554
fix: replace wildcard with terms
salvatore-campagna e668a28
fix: improve release highlight description
salvatore-campagna ea43e42
fix: improve release highlight description
salvatore-campagna df13f40
fix: improve release highlight description
salvatore-campagna bddfa7b
fix: improve release highlight description
salvatore-campagna 60b5f27
fix: improve release highlight description
salvatore-campagna File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -4,3 +4,21 @@ area: "Search" | |||||
type: enhancement | ||||||
issues: | ||||||
- 95541 | ||||||
highlight: | ||||||
title: Better indexing and search performance under concurrent indexing and search | ||||||
body: "When a query like a match phrase query or a terms query targets a constant keyword field \ | ||||||
we can skip the query execution on shards where the query is rewritten to match no documents.\ | ||||||
We take advantage of index mappings including constant keyword fields and rewrite queries in such a way that, if\ | ||||||
a constant keyword field does not match a value defined in the index mapping we rewrite the query to match no\ | ||||||
document. This will result in the shard level request to return immediately, before the query is executed on the data\ | ||||||
node and, as a result, skipping the shard completely. In a real world scenario it is likely that index patterns or\ | ||||||
data streams include tens or hundreds of backing indices each of them with multiple shards involved. Skipping shards\ | ||||||
in such scenario might result in better query performance and better cluster resource usage. Note, anyway, that\ | ||||||
execution of the pre-filter and the corresponding \"can match\" phase where rewriting happens, depends on the overall | ||||||
number of shards involved and on whether there is at least one of them returning a non-empty result (see\ | ||||||
'pre_filter_shard_size' setting to understand how to control this behaviour). We do the rewrite operation on the data\ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
node in the so called \"can match\" phase, taking advantage of the fact that, at that moment, we can access the index\ | ||||||
mapping and extract information about constant keyword fields and their value. This means we still \"fan-out\" the\ | ||||||
request from the coordinator node to involved data nodes. Doing the rewrite on the coordinator node is indeed not\ | ||||||
possible due to the unavailability of the index mapping." | ||||||
notable: true |
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.
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.
This exlpains how skipping shards helps with search performance, which is true, but Elasticsearch has had this for years. Let's focus instead of the new change, which is that the
can_match
phase no longer needs to refresh search-idle shards in a number of cases?Quickly mention better indexing performance here as well thanks to less refreshing and merging?