怎么又是你

constant_score查询不到es中已有的问题,这是为什么?

Elasticsearch | 作者 brew | 发布于2018年01月25日 | 阅读数:3344

我用的chrome的elasticsearch-head插件,使用简单查询 query_string 指定type为question的时候可以找到正确结果,但是使用constant_score复合查询时就没有结果。为什么呢?
 
这是查询DSL:

{
  "bool" : {
    "should" : [ {
      "constant_score" : {
        "filter" : {
          "match" : {
            "question" : {
              "query" : "你",
              "type" : "boolean"
            }
          }
        }
      }
    }, {
      "constant_score" : {
        "filter" : {
          "match" : {
            "question" : {
              "query" : "觉得",
              "type" : "boolean"
            }
          }
        }
      }
    }, {
      "constant_score" : {
        "filter" : {
          "match" : {
            "question" : {
              "query" : "我",
              "type" : "boolean"
            }
          }
        }
      }
    }, {
      "constant_score" : {
        "filter" : {
          "match" : {
            "question" : {
              "query" : "怎么样",
              "type" : "boolean"
            }
          }
        }
      }
    } ]
  }
}
 
已邀请:

要回复问题请先登录注册