Closed
Description
Elasticsearch version: 5.1
Plugins installed: []
JVM version (java -version
): Oracle 1.8
OS version (uname -a
if on a Unix-like system): OSX
Description of the problem including expected versus actual behavior:
When searching for a term that is in a list of synonyms, the query will not give results for terms in documents that would normally match a query with a fuzziness value. The query returns the expected document after removing the search term from the synonyms list.
Below is a reproduction of the issue. This occurs if the search analyzer is specified in the query or if it is defined on the field in the mapping.
PUT /test_index
{
"settings":{
"analysis":{
"analyzer":{
"synonym":{
"tokenizer":"standard",
"filter":[
"apostrophe",
"synonym"
]
}
},
"filter":{
"synonym":{
"type":"synonym",
"synonyms":[
"alf,fred"
]
}
}
}
}
}
PUT /test_index/person/1
{
"name": "ali"
}
GET /test_index/person/_search
{
"query":{
"match":{
"name":{
"query":"alf",
"analyzer":"synonym",
"fuzziness":"AUTO"
}
}
}
}