Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove lowercase_expanded_terms and locale from query-parser options. #20208

Merged
merged 1 commit into from
Nov 2, 2016

Conversation

jpountz
Copy link
Contributor

@jpountz jpountz commented Aug 29, 2016

Lucene 6.2 introduces the new Analyzer.normalize API, which allows to apply
only character-level normalization such as lowercasing or accent folding, which
is exactly what is needed to process queries that operate on partial terms such
as prefix, wildcard or fuzzy queries. As a consequence, the
lowercase_expanded_terms option is not necessary anymore. Furthermore, the
locale option was only needed in order to know how to perform the lowercasing,
so this one can be removed as well.

Closes #9978

@@ -82,7 +80,8 @@
private static final ParseField ALLOW_LEADING_WILDCARD_FIELD = new ParseField("allow_leading_wildcard");
private static final ParseField AUTO_GENERATE_PHRASE_QUERIES_FIELD = new ParseField("auto_generate_phrase_queries");
private static final ParseField MAX_DETERMINED_STATES_FIELD = new ParseField("max_determined_states");
private static final ParseField LOWERCASE_EXPANDED_TERMS_FIELD = new ParseField("lowercase_expanded_terms");
private static final ParseField LOWERCASE_EXPANDED_TERMS_FIELD = new ParseField("lowercase_expanded_terms")
.withAllDeprecated("Decision is now made by the analyzer");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really a deprecation ? Shouldn't we try to detect if the parameter is present and throw a nice exception if it happens ?

@jimczi
Copy link
Contributor

jimczi commented Aug 29, 2016

Left minor comments about deprecation vs exception, LGTM otherwise

@jpountz
Copy link
Contributor Author

jpountz commented Aug 29, 2016

@jimferenczi Thanks for having a look! The reasoning for using deprecation rather than throwing errors is to not force users to fix their queries at the same time as they upgrade the cluster, which is why I made clear in the upgrade notes that these parameters would be ignored. Since we should now do the right thing in all cases, I don't think this would cause bad surprises?

@jimczi
Copy link
Contributor

jimczi commented Aug 29, 2016

Since we should now do the right thing in all cases, I don't think this would cause bad surprises?

Fine with me, thanks for the explanation.

@jpountz
Copy link
Contributor Author

jpountz commented Oct 28, 2016

I revived this pull request now that Lucene 6.3 has the bugfix for normalization and DelegatingAnalyzer (https://issues.apache.org/jira/browse/LUCENE-7429). @jimczi Would you mind having another look?

Copy link
Contributor

@jimczi jimczi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

…ons.

Lucene 6.2 introduces the new `Analyzer.normalize` API, which allows to apply
only character-level normalization such as lowercasing or accent folding, which
is exactly what is needed to process queries that operate on partial terms such
as `prefix`, `wildcard` or `fuzzy` queries. As a consequence, the
`lowercase_expanded_terms` option is not necessary anymore. Furthermore, the
`locale` option was only needed in order to know how to perform the lowercasing,
so this one can be removed as well.

Closes elastic#9978
@jpountz jpountz force-pushed the remove_lowercase_expanded_terms branch from 9044e9b to b53b848 Compare November 2, 2016 09:34
@jpountz
Copy link
Contributor Author

jpountz commented Nov 2, 2016

@elasticmachine retest this please

@jpountz jpountz merged commit 52de064 into elastic:master Nov 2, 2016
@jpountz jpountz deleted the remove_lowercase_expanded_terms branch November 2, 2016 13:25
jpountz added a commit that referenced this pull request Nov 2, 2016
…ons. (#20208)

Lucene 6.2 introduces the new `Analyzer.normalize` API, which allows to apply
only character-level normalization such as lowercasing or accent folding, which
is exactly what is needed to process queries that operate on partial terms such
as `prefix`, `wildcard` or `fuzzy` queries. As a consequence, the
`lowercase_expanded_terms` option is not necessary anymore. Furthermore, the
`locale` option was only needed in order to know how to perform the lowercasing,
so this one can be removed as well.

Closes #9978
russcam added a commit to elastic/elasticsearch-net that referenced this pull request Jun 27, 2017
Add `quote_field_suffix` to simple_query_string query
Deprecate `lowercase_expanded_terms` and `locale`: elastic/elasticsearch#20208
Add "all field" execution mode to query_string and simple_query_string query: elastic/elasticsearch#20925

Fixes #2792
russcam added a commit to elastic/elasticsearch-net that referenced this pull request Jun 29, 2017
Add `quote_field_suffix` to simple_query_string query
Deprecate `lowercase_expanded_terms` and `locale`: elastic/elasticsearch#20208
Add "all field" execution mode to query_string and simple_query_string query: elastic/elasticsearch#20925

Fixes #2792
russcam added a commit to elastic/elasticsearch-net that referenced this pull request Jun 29, 2017
* Add missing fields on simple query string query

Add `quote_field_suffix` to simple_query_string query
Deprecate `lowercase_expanded_terms` and `locale`: elastic/elasticsearch#20208
Add "all field" execution mode to query_string and simple_query_string query: elastic/elasticsearch#20925

Fixes #2792

* Convert to property expressions
russcam added a commit to elastic/elasticsearch-net that referenced this pull request Jun 29, 2017
* Add missing fields on simple query string query

Add `quote_field_suffix` to simple_query_string query
Deprecate `lowercase_expanded_terms` and `locale`: elastic/elasticsearch#20208
Add "all field" execution mode to query_string and simple_query_string query: elastic/elasticsearch#20925

Fixes #2792

* Convert to property expressions

(cherry picked from commit bef4b9d)
awelburn pushed a commit to Artesian/elasticsearch-net that referenced this pull request Nov 6, 2017
* Add missing fields on simple query string query

Add `quote_field_suffix` to simple_query_string query
Deprecate `lowercase_expanded_terms` and `locale`: elastic/elasticsearch#20208
Add "all field" execution mode to query_string and simple_query_string query: elastic/elasticsearch#20925

Fixes elastic#2792

* Convert to property expressions

(cherry picked from commit bef4b9d)
@clintongormley clintongormley added :Search/Search Search-related issues that do not fall into other categories and removed :Query DSL labels Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search/Search Search-related issues that do not fall into other categories v5.1.1 v6.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove lowercase_expanded_terms option
3 participants