Skip to content

Synonyms break fuzziness #25518

Closed
Closed
@jjfalling

Description

@jjfalling

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"
         }
      }
   }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Search Relevance/AnalysisHow text is split into tokens:Search/SearchSearch-related issues that do not fall into other categories>bugTeam:Search RelevanceMeta label for the Search Relevance team in Elasticsearch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions