I defined a standard analyzer & mapping that I was surprised not built-in.
PUT /_template/mytemplate
{
"template": "kindex*",
"settings": {
"analysis": {
"analyzer": {
"kanalyzer": {
"type": "standard",
"stopwords": "the"
}}
}},
"mappings" : {
"kindex" : {
"properties" : {
"message" : { "type" : "string","analyzer" : "kanalyzer"}
}
}
}
}
Then i put different values in my kindex/ktype
PUT /kindex/ktype/3
{
"message":"this is abc the work "
}
PUT /kindex/ktype/2
{
"message":"this is xyz the work "
}
when i am searching it with
localhost:9200/kindex/ktype/_search
It give output as it is not by removing "the" word as written in my analyzer.
It looks like elasticsearch performs the search with the default analyzer, which doesn't make sense. Shouldn't it perform the search with each field's own default analyzer?
please help me out.