Skip to content

Fix case sensitivity rules for wildcard queries on text fields (#71751)#72216

Merged
cbuescher merged 1 commit intoelastic:7.12from
cbuescher:backport-71751-12-1
Apr 26, 2021
Merged

Fix case sensitivity rules for wildcard queries on text fields (#71751)#72216
cbuescher merged 1 commit intoelastic:7.12from
cbuescher:backport-71751-12-1

Conversation

@cbuescher
Copy link
Copy Markdown
Member

Wildcard queries on text fields should not apply the fields analyzer to the
search query. However, we accidentally enabled this in #53127 by moving the
query normalization to the StringFieldType super type. This change fixes this by
separating the notion of normalization and case insensitivity (as implemented in
the case_insensitive flag). This is done because we still need to maintain
normalization of the query sting when the wildcard query method on the field type is
requested from the query_string query parser. Wildcard queries on keyword
fields should also continue to apply the fields normalizer, regardless of
whether the case_insensitive is set, because normalization could involve
something else than lowercasing (e.g. substituting umlauts like in the
GermanNormalizationFilter).

Backport of #71751

…ic#71751)

Wildcard queries on text fields should not apply the fields analyzer to the
search query. However, we accidentally enabled this in elastic#53127 by moving the
query normalization to the StringFieldType super type. This change fixes this by
separating the notion of normalization and case insensitivity (as implemented in
the `case_insensitive` flag). This is done because we still need to maintain
normalization of the query sting when the wildcard query method on the field type is
requested from the `query_string` query parser. Wildcard queries on keyword
fields should also continue to apply the fields normalizer, regardless of
whether the `case_insensitive` is set, because normalization could involve
something else than lowercasing (e.g. substituting umlauts like in the
GermanNormalizationFilter).

Closes elastic#71403
@cbuescher cbuescher merged commit 2646e3a into elastic:7.12 Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant