I'm unable to perform a search using a filtered term query on a numeric value (ES 2.3), despite according the doc (term Query with numbers) it should work:
GET log_*/_search
{
  "query": {
    "bool": {
      "filter": [
        {"term": {"message.type": "processing"}}
      ]
    }
  }
Result:
{
  "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 ... 
    ]
  }
}
If I query for the same message.trackid returned in the previous query...
GET log_*/_search
{
  "query": {
    "bool": {
      "filter": [
        {"term": {"message.trackid": 1767513415295398400}}
      ]
    }
  }
}
...I get nothing:
{
  "took": 2,
  "timed_out": false,
  "hits": {
    "total": 0,
    "max_score": null,
    "hits": []
  }
}
Mapping of the field:
{
  "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
    }
  }
}
Any thought?
