title: Elasticsearch term query not working on numbers
body: <p>I'm unable to perform a search using a filtered <code>term</code> query on a numeric value (ES 2.3), despite according the doc (<a href="https://www.elastic.co/guide/en/elasticsearch/guide/current/_finding_exact_values.html#_term_query_with_numbers" rel="nofollow noreferrer">term Query with numbers</a>) it should work:</p>
  
  <pre class="lang-json prettyprint-override"><code>GET log_*/_search
  
  {
    "query": {
      "bool": {
        "filter": [
          {"term": {"message.type": "processing"}}
        ]
      }
    }
  </code></pre>
  
  <p>Result:</p>
  
  <pre class="lang-json prettyprint-override"><code>{
    "took": 7,
    "timed_out": false,
    "hits": {
      "total": 9454958,
      "max_score": 0,
      "hits": [
        {
          "_index": "log_2018-07-20",
          "_type": "INFO",
          "_id": "AWS3u23h9aQ1Q463t1cE",
          "_score": 0,
          "_source": {
            "message": {
              "trackid": 1767513415295398400,
              "type": "processing",
              // other data ...
            },
            "ts": "2018-07-20T12:47:46.867271"
          }
        },
  
       // other results ... 
  
      ]
    }
  }
  </code></pre>
  
  <p>If I query for the same <code>message.trackid</code> returned in the previous query...</p>
  
  <pre class="lang-json prettyprint-override"><code>GET log_*/_search
  
  {
    "query": {
      "bool": {
        "filter": [
          {"term": {"message.trackid": 1767513415295398400}}
        ]
      }
    }
  }
  </code></pre>
  
  <p>...I get nothing:</p>
  
  <pre class="lang-json prettyprint-override"><code>{
    "took": 2,
    "timed_out": false,
    "hits": {
      "total": 0,
      "max_score": null,
      "hits": []
    }
  }
  </code></pre>
  
  <p>Mapping of the field:</p>
  
  <pre class="lang-json prettyprint-override"><code>{
    "log_2018-07-20": {
      "mappings": {
        "ERROR": {
          "properties": {
            "message": {
              "properties": {
                "trackid": {
                  "type": "long"
                },
                // other fields...
              }
            }
          }
        },
        "INFO": {
          "properties": {
            "message": {
              "properties": {
                "trackid": {
                  "type": "long"
                },
                // other fields...
              }
            }
          }
        },
        // you got the idea
      }
    }
  }
  </code></pre>
  
  <p>Any thought?</p>