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:
PUT test_index
{
"settings": {
"analysis": {
"analyzer": {
"my_custom_analyzer": {
"type": "custom",
"tokenizer": "standard",
"filter": ["stop", "porter_stem" ]
}
}
}
}
}
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???