I tried to re-create your whole example now and all seems to work well for me, at least on 6.4.3.
See my the reproduction below to check where the differences might be? I haven't asked yet but which version of ES are you using?
DELETE /syn_search_test
PUT /syn_search_test
{
"settings": {
"index": {
"analysis": {
"filter": {
"search_synonym_filter": {
"type": "synonym",
"lenient": true,
"synonyms": [
"well, in_force, serious, undecomposed, commodity"
]
}
},
"analyzer": {
"search_synonyms": {
"type": "custom",
"tokenizer": "keyword",
"filter": [
"lowercase",
"search_synonym_filter"
]
}
}
}
}
}
}
POST /syn_search_test/_doc/_bulk
{ "index" : { "_id" : "1" } }
{ "text":"This dog is the well one"}
{ "index" : { "_id" : "2" } }
{ "text":"This dog is the in_force one"}
{ "index" : { "_id" : "3" } }
{ "text":"This dog is the serious one" }
{ "index" : { "_id" : "4" } }
{ "text":"This dog is the undecomposed one" }
{ "index" : { "_id" : "5" } }
{ "text":"This dog is the commodity one" }
{ "index" : { "_id" : "6" } }
{ "text":"This dog is the honorable one" }
{ "index" : { "_id" : "7" } }
{ "text":"This dog is the skilful one" }
{ "index" : { "_id" : "8" } }
{ "text":"This dog is the dependable one" }
{ "index" : { "_id" : "9" } }
{ "text":"This dog is the expert one" }
{ "index" : { "_id" : "10" } }
{ "text":"This dog is the honest one" }
GET /syn_search_test/_search
{
"query": {
"match": {
"text": {
"query": "well",
"analyzer": "search_synonyms"
}
}
}
}
Gives:
{
"took": 11,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 5,
"max_score": 1.2039728,
"hits": [
{
"_index": "syn_search_test",
"_type": "_doc",
"_id": "5",
"_score": 1.2039728,
"_source": {
"text": "This dog is the commodity one"
}
},
{
"_index": "syn_search_test",
"_type": "_doc",
"_id": "2",
"_score": 0.9808292,
"_source": {
"text": "This dog is the in_force one"
}
},
{
"_index": "syn_search_test",
"_type": "_doc",
"_id": "4",
"_score": 0.9808292,
"_source": {
"text": "This dog is the undecomposed one"
}
},
{
"_index": "syn_search_test",
"_type": "_doc",
"_id": "1",
"_score": 0.6931472,
"_source": {
"text": "This dog is the well one"
}
},
{
"_index": "syn_search_test",
"_type": "_doc",
"_id": "3",
"_score": 0.2876821,
"_source": {
"text": "This dog is the serious one"
}
}
]
}
}