title: How to execute an IP Range Query/Filter
body: <p>I am trying to get an IP range query to work over a set of documents, and am getting no results.</p>
  
  <p>Mapping (I've tried both <code>analyzed</code> and <code>not_analyzed</code>):</p>
  
  <pre><code>   "mappings": {
        "addy": {
           "properties": {
              "add": {
                 "type": "ip",
                 "not_analyzed":"true"
              }
           }
        }
     }
  </code></pre>
  
  <p>The data looks like this (many instances of this with varying values)</p>
  
  <pre><code>   "_source": {
         "add": "192.168.1.15"
     }
  </code></pre>
  
  <p>Now, I went looking at the official ES docs, but there was not IP range example, but <a href="https://github.com/elastic/elasticsearch/issues/7464" rel="nofollow">I found one on the Git</a> , which didn't work. It looks as follows:</p>
  
  <pre><code>    "query": {
          "query_string": {
             "default_field": "add",
             "query": "add:[192.168.1.5 TO 192.168.1.15]"
          }
      }
  </code></pre>
  
  <p>The above threw some encourage parse errors when I was fat fingering my fields and addresses, but in the end returned no results.</p>
  
  <p>I also tried standard range syntax:</p>
  
  <pre><code>"filter": {
      "range": {
         "add": {
            "from": "192.168.1.5",
            "to": "192.168.1.25"
         }
      }
  }
  </code></pre>
  
  <p>Which also returned no results. How do I query a range of IP addresses?</p>