elastisearch查询工作中的default_operator参数不正确

时间:2018-09-04 16:29:31

标签: elasticsearch elasticsearch-5

我尝试发送此查询:

 {
  "query": {
    "function_score": {
      "query": {
        "bool": {
          "must": {
            "query_string": {
              "query": "oracle AND san AND francisco AND hadoop",
              "fuzzy_transpositions": false,
              "auto_generate_synonyms_phrase_query": false
            }
          },
          "disable_coord": false,
          "adjust_pure_negative": false,
          "boost": 1.1
        }
      }
    }
  }
}

获得总结果: 10209

如果我添加查询“ default_operator”参数:

{
  "query": {
    "function_score": {
      "query": {
        "bool": {
          "must": {
            "query_string": {
              "query": "oracle san francisco hadoop",
              "default_operator": "AND",
              "fuzzy_transpositions": false,
              "auto_generate_synonyms_phrase_query": false
            }
          },
          "disable_coord": false,
          "adjust_pure_negative": false,
          "boost": 1.1
        }
      }
    }
  }
}

获得总结果: 431。

也许有人知道有什么不同吗?

弹性搜索版本6.4。

0 个答案:

没有答案