即使在尝试了解弹性搜索数小时之后,我也无法理解如何在搜索具有特殊字符的文本时获得相同的结果。
我对icu_folding做错了什么?我怎样才能达到"Škoda“和"Skoda”一样的结果呢?有可能吗?
发布于 2017-01-21 16:43:16
您正在将icu_folding令牌筛选器应用于name.sort子字段,而不是name字段本身,因此您的查询需要如下所示:
# 1 result as expected
curl -XGET 'localhost:9200/my_index/_search?pretty' -d'
{
"query": { "match": { "name.sort": "Škoda" } }
}'
# 0 results - I expected the same behaviour
curl -XGET 'localhost:9200/my_index/_search?pretty' -d'
{
"query": { "match": { "name.sort": "Skoda" } }
}'https://stackoverflow.com/questions/41779355
复制相似问题