Long data type of es confuses things

I have a business key id in the fields of my type, which a long data type. And here is the mapping of the corresponding type(part of the mapping):

 "npms_id": {
                  "type": "long"
               },

Here is the severe problem I came up with: The npms_id I send to the es server is different from the one in the result JSON returned by Elasticsearch server. For example, I have a query like this:

GET /index/type/_search
{
  "query" :{
    "term" : {
      "npms_id": 91447292341973010
    }
  }
}

I will not get any result. But if I change the search npms_id, like this:

GET /index/type/_search
{
  "query" :{
    "term" : {
      "npms_id": 91447292341973001
    }
  }
}

I will get the result of npms_id: 91447292341973010. So I doubt that the true value stored in the shards is 91447292341973001, but what confuses me is why 91447292341973010 is returned or just displayed. In order to get the details of this search, I have done it by enabling the profile function. And the result is gisted here. In addition, the version of my elasticsearch is 5.2.0. Hopefully, this is not a bug problem of this version. Any suggestions are really appreciated here because I'm really stuck on this problem. Thank you guys in advance!

Hm, I'm not sure... I can't replicate this with a fresh copy of 5.2.0.

Did you happen to use Transforms in the past, and then upgrade to 5.x? Transforms would allow the source and the indexed data to not match (similar to how analysis can alter text).

No, all data are indexed into the fully new cluster of ES-5.2.0. The behavior of es is just weird for now.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.