I'm new in elastic search...can anyone help to create a query that will search multiple values with ignoring case.
if I use lower case then below search query is working properly but when I use UPPER case it is not returning data so do I have to convert into lower 1st or is there any way to search by ignoring the case?
Using a match query will analyze the data in the same way as the text was analyzed, usually. Have a look at analyzers for text fields and then read about normalizers for keyword fields.
I don't believe there is a way to use the terms query with analyzed terms though. But it is fine to use bool with should clauses, usually. terms is required only if you have many, many terms to match. If you don't it is automatically rewritten to bool with should clauses, actually.
I'm little bit aware of normalizers/analyzers that they are converting into lower case before indexing it and before executing query etc.
And its good to know that terms will automatically be rewritten into bool with should clauses.
Is there any fields to ignore case or something else?
No. At the moment you either use terms and lowercase on your side or use match inside bool. I don't know off hand if we've talked through a match-like thing that works using terms.
terms is likely going to be faster every time but it is worth benchmarking with real data to see how much faster. Even if that benchmark is just a quick and dirty bash script with ab. Then you'll know how much faster. And whether or not it is worth adding something to ES. If it turns out that it is much faster for you use case we'd certainly consider adding it. I would, at least.
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.