elasticsearch query_string过滤器语法错误(版本1.7.x)

时间:2016-01-27 12:11:17

标签: elasticsearch

即时搜索以下查询中的错误,因为它不会带来任何结果。我希望它像术语过滤器一样,并在国家/设备字段中查找确切的值

GET idx/type/_search
{
 "query": {
 "filtered": {
  "filter": {
    "and": {
      "filters": [
        {
          "query": {
            "query_string": {
              "query": "country:\"united kingdom\" AND device:\"desktop\""
            }
          }
        }
      ]
    }
  }
}
}
}

具体来说,这有效:

  "query": {
            "query_string": {
              "query": "\"united kingdom\""
            }
          }

但这不起作用:

"query": {
            "query_string": {
              "query": "country:\"united kingdom\""
            }
          }

映射:

"country": {
              "type": "string",
              "index": "not_analyzed",
              "doc_values": true
           },

0 个答案:

没有答案