ElasticSearch and Sense - get results when a field is null
<p>I'm using elasticsearch 2.3.1, and trying to write a query to filter on <code>_score</code> field.</p>

<p>I need to check whether <code>_score</code> is <strong>not null</strong>.</p>

<p>Here is what i've tried:</p>

<p><strong>REQUEST</strong></p>

<pre><code>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"
    }
  }
}
</code></pre>

<p><strong>RESPONSE</strong></p>

<pre><code>{
   "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
}
</code></pre>