【发布时间】:2020-03-29 06:55:44
【问题描述】:
示例文档
{
"id": 5,
"title": "Quick Brown fox jumps over the lazy dog",
"genre": [
"fiction"
]
}
映射
{
"movies" : {
"mappings" : {
"properties" : {
"genre" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"id" : {
"type" : "long"
},
"title" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
}
}
}
查询 1: 之前共享的文档中的结果
{
"query": {
"match_phrase": {
"title": {
"query": "fox quick over", "slop": 3
}
}
}
}
查询 2: 没有结果
{
"query": {
"match_phrase": {
"title": {
"query": "over fox quick", "slop": 3
}
}
}
}
我期待查询 2 中的结果,而不是查询 1 中的结果。
【问题讨论】:
-
也请分享您的索引映射。调试查询会更容易。
-
@Harshit:嘿...添加了映射。谢谢
标签: elasticsearch elasticsearch-query phrase