有一个俄语单词“pizza”=“пицца”,因为它们非常相似:
"p" equals to "п"
"i" equals to "и"
"z" equals to "ц"
"z" equals to "ц"
"a" equals to "а"
因此,当我搜索“пицца”时,我必须以“披萨”结果获得所有结果。
我怎样才能做到这一点?
答案 0 :(得分:1)
问题解决了,它解决的方式不是我的预期,但仍然,它只是有效,这是解决方案:
"settings": {
"analysis": {
"filter": {
"ru_synonym": {
"type": "synonym",
"synonyms": [
"pizza, пицца"
]
}
},
"analyzer": {
"ru_analyzer": {
"type": "custom",
"tokenizer": "whitespace",
"filter": [
"lowercase",
"ru_synonym"
]
}
}
}
}