mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 10:25:15 +00:00
Clarify pure wilcard matching with query_string
(#26814)
In 5.x pure wildcard queries `*` in `query_string` are rewritten to `exists` query for efficiency. Though this introduced a change in the document that match such queries because `exists` query also return documents with an empty value for the field. This change clarifies this behavior for 5.x and beyond. Closes #26801 * review
This commit is contained in:
parent
d1533e2397
commit
17b9baf5fd
@ -53,6 +53,25 @@ Be aware that wildcard queries can use an enormous amount of memory and
|
||||
perform very badly -- just think how many terms need to be queried to
|
||||
match the query string `"a* b* c*"`.
|
||||
|
||||
[WARNING]
|
||||
=======
|
||||
Pure wildcards `\*` are rewritten to <<query-dsl-exists-query,`exists`>> queries for efficiency.
|
||||
As a consequence, the wildcard `"field:*"` would match documents with an emtpy value
|
||||
like the following:
|
||||
```
|
||||
{
|
||||
"field": ""
|
||||
}
|
||||
```
|
||||
\... and would **not** match if the field is missing or set with an explicit null
|
||||
value like the following:
|
||||
```
|
||||
{
|
||||
"field": null
|
||||
}
|
||||
```
|
||||
=======
|
||||
|
||||
[WARNING]
|
||||
=======
|
||||
Allowing a wildcard at the beginning of a word (eg `"*ing"`) is particularly
|
||||
|
Loading…
x
Reference in New Issue
Block a user