我以弹性方式使用这些查询,但问题是,当我替换值时会得到不同的结果,或者当我单独使用每个单词时,我们会有不同的结果。这是我查询的一部分
"query_string" : {
"query" : "businessId : 1848 4335",
"fields" : []
}
result : "hits": {"total": 81,....}
替换businessIds时:
"query_string" : {
"query" : "businessId : 4335 1848",
"fields" : []
}
result : "hits": {"total": 162,...}
当我搜索“ 4335”时
"query_string" : {
"query" : "businessId : 4335",
"fields" : []
}
result : "hits": {"total": 0,...}
搜索“ 1848”
"query_string" : {
"query" : "businessId : 1848",
"fields" : []
}
result : "hits": {"total": 14,...}
当我在字段中使用“ businessId”时
"query_string" : {
"query" : "4335 1848",
"fields" : ["businessId"]
}
result : "hits": {"total": 14,...}
我很困惑为什么会发生这些结果?
任一
{
"query": {
"query_string": {
"query": "businessId:4335 OR businessId:1848"
}
}
}
或
{ "query": { "query_string": { "query": "businessId:(4335 OR 1848)" } } }