title: How to get documents with non-null field in Elastic search?
body: <p>I have this query which gives me documents using the filter. How do I make sure the coordinates field in not empty/null? </p>
  
  <pre><code> {
      "size":1,
      "_source": ["coordinates"]
      "query": {
          "filtered": {
              "query": {
                  "match_all": {}
              },
              "filter": {
  
                  "range": {
                      "timestamp_ms": {
                          "gte": "1468015200000",
                          "lte": "1468022400000"
                      }
                  }
              }
          }
      }    
  }   
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>{
    "took" : 41,
    "timed_out" : false,
    "_shards" : {
      "total" : 5,
      "successful" : 5,
      "failed" : 0
    },
    "hits" : {
      "total" : 79112,
      "max_score" : 1.0,
      "hits" : [ {
        "_index" : "twitter",
        "_type" : "tweet",
        "_id" : "751536344866910208",
        "_score" : 1.0,
        "_source" : {
          "coordinates" : null
        }
      } ]
    }
  }
  </code></pre>
  
  <p>this is the mapping:</p>
  
  <pre><code>"coordinates" : {
      "properties" : {
          "coordinates" : {
              "type" : "geo_point"
          },
          "type" : {
              "type" : "string",
              "index" : "not_analyzed"
          }
      }
  }
  </code></pre>