I get the same score for all documents when I run the following:
DELETE index
PUT index
{
"settings": {
"number_of_shards": 1,
"analysis": {
"filter": {
"my_syns": {
"type": "synonym",
"synonyms" : [
"shirt,blouse"
]
}
},
"analyzer": {
"my_index_analyzer": {
"type": "custom",
"tokenizer": "whitespace"
},
"my_search_analyzer": {
"type": "custom",
"tokenizer": "whitespace",
"filter": ["my_syns"]
}
}
}
},
"mappings": {
"doc": {
"properties": {
"field": {
"type": "text",
"analyzer": "my_index_analyzer",
"search_analyzer": "my_search_analyzer"
}
}
}
}
}
PUT index/doc/1
{
"field": "shirt xyz"
}
PUT index/doc/2
{
"field": "blouse xyz"
}
GET index/_search
{
"query": {
"match": {
"field": "shirt"
}
}
}