【发布时间】:2018-12-10 11:12:56
【问题描述】:
是否可以对术语查询使用模糊而不匹配? 让我解释一下:
假设我们有 4 个文档
{ "index": { "_id": 1 }}
{ "text": "I play football!"}
{ "index": { "_id": 2 }}
{ "text": "I love playing"}
{ "index": { "_id": 3 }}
{ "text": "X is the best player"}
{ "index": { "_id": 4 }}
{ "text": "plyaer"}
使用时:
GET /index/my_type/_search
{
"query": {
"fuzzy": {
"value": "player",
"fuzziness": 1
}
}
}
我明白了:
{ "index": { "_id": 3 }}
{ "text": "X is the best player"}
{ "index": { "_id": 4 }}
{ "text": "plyaer"}
但我只想要一个 plyaer 的结果,它对应于 fuzziness=1 的“精确”匹配(“术语”)
【问题讨论】:
标签: elasticsearch