Skip to content
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

18 changes: 18 additions & 0 deletions docs/changelog/96161.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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\
Copy link
Contributor

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?

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\
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'pre_filter_shard_size' setting to understand how to control this behaviour). We do the rewrite operation on the data\
'pre_filter_shard_size' setting to understand how to control this behaviour). Elasticsearch does the rewrite operation on the data\

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