-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Option for case insensitive search at runtime #61162
Comments
Pinging @elastic/es-search (:Search/Search) |
I wonder if we really need new queries or if we could reuse AutomatonQuery to build case-insensitive variants? |
PrefixQuery and WildcardQuery already do reuse AutomatonQuery? They're lightweight subclasses that take args and implement a
The |
The problem we have with the beats templates is they explicitly set each field, which takes priority over any settings applied through dynamic templates. In event-management and incident response, we need case insensitive search to mitigate the risk of important events being missed due to keywords being case sensitive, and data being collected from many different systems on the network. We would need to write a lot of code to do the string normalisation for every field in every parser/Logstash. Instead we have a python script which adds the lowercase normaliser to every field in the beats template. But this means we have to run the template through the script every time a new version is released. With elastic moving to doing beats/template management through fleet, and enrichment moving from the javascript to ingest pipeline, we would still have to run each template through the python script to add the lowercase normaliser. We would be happy with an index level setting which adds the lowercase normaliser to every field when the index is created. That way teams who want to lowercase all keywords can apply this setting once in the index settings, and use KQL to do case-insensitive search without needing to add multi-fields. |
Closing as complete because with the 2 remaining tasks there were issues: Query string case insensitive regex - there was no clean way to add the /i syntax to Lucene in a backwards compatible way. Terms query - concerns over query complexity explosion and performance meant |
This meta issue tracks the various changes relating to offering a "case insensitive" option to various term-level queries (
term
,terms
,prefix
,wildcard
,regex
) at search time. It replaces the previous #53603 which meandered with various discussions.In query DSL we will offer a new
case_insensitive
flag which can only be set to true to enable new behaviour. When left unset the existing behaviour is used (which is inconsistent -keyword
fields with normalizers normalize query terms whiletext
fields do not). Due to these inconsistencies and lack of guarantees, setting thecase_insensitive
flag to false will throw an error.Tasks
regexp
queries in elasticsearch DSL - Issue PR Search - add case insensitive support for regex queries. #59441query_string
support for/Foo/i
regex syntax - PR LUCENE-9445 Add support for case insensitive regex searches in QueryParser apache/lucene-solr#1708The text was updated successfully, but these errors were encountered: