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).

Closes #71403

…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
@cbuescher cbuescher changed the title Fix case sensitivity rules for wildcard queries on text fields (#71751) (#72214) Fix case sensitivity rules for wildcard queries on text fields (#71751) Apr 26, 2021
@cbuescher cbuescher merged commit aba9113 into elastic:7.13 Apr 26, 2021
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