Hi,
I have multiple attributes stored in ES with keyword datatype. I was wondering if it is possible to perform a case in-sensitive search using a match query on these keyword fields?
Thanks.
Hi,
I have multiple attributes stored in ES with keyword datatype. I was wondering if it is possible to perform a case in-sensitive search using a match query on these keyword fields?
Thanks.
Have a look at the normalizer property. If you add a lowercase
normalizer then you should get case insensitive search.
Thanks for your reply.
I have a couple of questions:
Thanks
Storage will be the same but you would have to rebuild the index with the new normalizer.
This is the fastest way to do case insensitive search.
You need to recreate the index after changing the normalizer because it'd build a different on disk structure. You may be able to use dynamic templates to automatically configure the normalizer on your index.
Hi,
I had this problem and use of normalizer property solved it, but it caused a new problem. I have highlighting feature in my query along side with case insensitive keyword search. When I included normalizer property in my mapping, highlighting has stopped working. Do you know why?
Hi @nik9000, I was reading through the documentation for keyword datatype, and it says herehttps://www.elastic.co/guide/en/elasticsearch/reference/current/keyword.html that normalizer is an experimental feature and might go away in a future release.
Am I looking at the wrong documentation or it is indeed the case? Is there a more stable way of achieving case insensitive search? Like converting the keyword to a text field and using a custom analyzer?
Thanks
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.