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:
Jim Ferenczi 2017-10-04 09:55:26 +02:00 committed by GitHub
parent d1533e2397
commit 17b9baf5fd

View File

@ -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