以下是示例(简化):
POST people/_mapping/_doc { "properties": { "name": { "type": "text" }, "bio": { "type": "text", "fields": { "keyword": { "type": "keyword" } } } } }
下面是一个问题:
POST people/_search { "query": { "match": { "bio.keyword": "Portugal" } } }
同样的情况也会发生在葡萄牙和葡萄牙之间。这种行为的原因是什么?
在elasticseach中,如果有文本类型字段 description .
description
He likes dog but hate cat.
He/like/dog/but/hate/cat
关键字字段要求100%匹配。
知道了:
参考文献: https://www.elastic.co/guide/en/elasticsearch/reference/current/keyword.html