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

Don't honor lowercase expanded terms in regex query generated from query string query #3922

Closed
mattweber opened this issue Oct 16, 2013 · 8 comments
Labels

Comments

@mattweber
Copy link
Contributor

On the mailing list a user was using a query string query against an unanalyzed field that contained values such as:

5.2
5.3-SNAPSHOT

He wanted to return all documents that were not a snapshot version so they used a query string like -version:/.*SNAPSHOT/. This did not work. Turns out that lowercase_expanded_terms was turning the regex into -version:/.*snapshot/ which doesn't match the unanalyzed field due to case.

He was using Kibana which does not currently expose the lowercaseExpandedTerms option, so the user really had no way to fix this without changing the mapping and reindexing or patching kibana.

Should the lowercase_expanded_terms option even be honored in a regex query? I would think no.

I did not see a way to set a case insensitive flag on the lucene regex query and the (?i) flag from java regex did not work.

@clintongormley
Copy link

Or at least we shouldn't lowercase expanded terms when we're querying a not_analyzed field

@amitelad7
Copy link

+1 running into this issue as well

@clintongormley
Copy link

We should add a (default) third setting for the lowercase_expanded_terms of auto. That will only lowercase if the field is analyzed, but not if it is not analyzed.

@NickMeves
Copy link

+1

Was about to open a new issue then I stumbled across this. Running into this alot lately with both Kibana and Graylog.

Issue is with not_analyzed field using regex for us as well.

@khadrin
Copy link

khadrin commented Jul 20, 2015

👍

@pickypg
Copy link
Member

pickypg commented Aug 19, 2015

I wonder why we even need this setting. The analysis process should take care of lowercasing, if it's desirable for the fields in question, which is not a query-global decision, and it should otherwise not touch the entry.

@pickypg
Copy link
Member

pickypg commented Aug 19, 2015

Highly related to #9978

@clintongormley
Copy link

Closing in favour of #9978

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants