Hello every one
I have been trying to activate case sensitive search in elasticsearch and what i found is it depend on type of analyzer. so i create a custom analyzer:
}
}
after that i indexed some document to my test index in field message:
error
[ERROR]
ErrorSome
SomeERROR
what i am trying to do is to find out the document which only contain ERROR term not error or Error(exactly the word ERROR).so i wrote this query:
GET /test_index/_search
{
"query": {
"query_string": {
"default_field": "message",
"query": "ERROR"
}
}
}
this query give me all document which contain the word error and does not care it is upper case or lower case
what is the problem??am i looking to right direction to solve the problem??is it related to analyzer???
Thanks alot.. Yes it worked.. I thought when i defined the customer analyzer then it applied as default analyzer to all field and i do not need mapping..
If i want to consider speciall character such as [ or ] then i need to define another tokenizer?? Which one do you recommend??
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.