I just reviewed this video - https://www.youtube.com/watch?v=7FLXjgB0PQI and got one question about ElasticSearch analyzers. I've read official documentation and few other articles about analysis and analyzers and I'm confused a bit.
For example I have the following index configuration:
"settings" : {
"analysis" : {
"filter" : {
"autocomplete" : {
"type" : "edge_ngram",
"min_gram" : 1,
"max_gram" : 20
}
},
"analyzer" : {
"autocomplete" : {
"type" : "custom",
"tokenizer" : "standard",
"filter" : ["lowercase", "autocomplete"]
}
}
}
},
"mappings" : {
"user" : {
"properties" : {
"name" : {
"type" : "multi_field",
"fields" : {
"name" : {
"type" : "string",
"analyzer" : "standard"
},
"autocomplete" : {
"type" : "string",
"index_analyzer" : "autocomplete",
"search_analyzer" : "standard"
}
}
}
}
}
}
Then I do following search request separately:
{
"match" : {
"name.autocomplete" : "john smi"
}
}
and this:
{
"match" : {
"name" : "john smi"
}
}
If I understood correctly I had to see the same result because in both cases ES should use standard analyzer, but I got different results. Why?
UPDATE
I have following collection of names in the index: "john smith", "johnathan smith".