Skip to content

Conversation

@cbuescher
Copy link
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 a1cc706 into elastic:7.x Apr 26, 2021
cbuescher pushed a commit to cbuescher/elasticsearch that referenced this pull request Apr 26, 2021
…ic#71751) (elastic#72214)

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant