我有两个查询,我认为应该返回相同数量的结果。首先是在 2 个字段上带有 query_string 的“必须”。例如
{
"query": {
"nested": {
"path": "app.pub",
"query": {
"bool": {
"must": [
{
"query_string": {
"query": "wheel* chair* foot* driven*",
"fields": [
"app.pub.title.*.docdba",
"app.pub.abstract.*.docdba"
],
"default_operator": "and"
}
}
]
}
}
}
}
}
这给了我 120 个结果。第二个是“应该”查询,在标题字段或摘要上搜索带有通配符的相同字符串。例如:
{
"query": {
"nested": {
"path": "app.pub",
"query": {
"bool": {
"should": [
{
"query_string": {
"query": "wheel* chair* foot* driven*",
"fields": [
"app.pub.title.*.docdba"
],
"default_operator": "and"
}
},
{
"query_string": {
"query": "wheel* chair* foot* driven*",
"fields": [
"app.pub.abstract.*.docdba"
],
"default_operator": "and"
}
}
]
}
}
}
}
}
在这里,我得到 109 个结果。所以我的点击次数减少了 11 次。有人知道为什么吗?