ElasticSearch和Sense - 当字段为空时获取结果

时间:2016-04-18 07:15:19

标签: elasticsearch sense

我正在使用elasticsearch 2.3.1,并尝试编写查询以过滤_score字段。

我需要检查POST /_search { "from" : 0, "size" : 200, "query": { "bool": { "must": [ { "term": { "_type": "monitor" } } ], "must_not": [ { "term": { "_score": { "value": null } } } ] } }, "sort": { "TraceDateTime": { "order": "desc", "ignore_unmapped": "true" } } } 是否为空

以下是我的尝试:

请求

{
   "error": {
      "root_cause": [
         {
            "type": "query_parsing_exception",
            "reason": "No value specified for term query",
            "index": ".kibana",
            "line": 18,
            "col": 15
         },
         {
            "type": "query_parsing_exception",
            "reason": "No value specified for term query",
            "index": "monitors",
            "line": 18,
            "col": 15
         }
      ],
      "type": "search_phase_execution_exception",
      "reason": "all shards failed",
      "phase": "query",
      "grouped": true,
      "failed_shards": [
         {
            "shard": 0,
            "index": ".kibana",
            "node": "IjGeW1YgSiiUY1devzlAgQ",
            "reason": {
               "type": "query_parsing_exception",
               "reason": "No value specified for term query",
               "index": ".kibana",
               "line": 18,
               "col": 15
            }
         },
         {
            "shard": 0,
            "index": "monitors",
            "node": "IjGeW1YgSiiUY1devzlAgQ",
            "reason": {
               "type": "query_parsing_exception",
               "reason": "No value specified for term query",
               "index": "monitors",
               "line": 18,
               "col": 15
            }
         }
      ]
   },
   "status": 400
}

RESPONSE

{{1}}

0 个答案:

没有答案