Elasticsearch synonym analyzer not working

喜夏-厌秋 提交于 2019-12-04 02:51:51

The order of the filters is

filter":[
    "lowercase",
    "synonym_filter"
]

So, if elasticsearch is "lowercasing" first the tokens, when it executes the second step, synonym_filter, it won't match any of the entries you have defined.

To solve the problem, I would define the synonyms in lower case

You can also define your synonyms filter as case insensitive:


    "filter":{
        "synonym_filter":{
            "type": "synonym",
            "ignore_case" : "true",
            "synonyms":[
                ...
            ]
        }
    }

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!