1

I am trying to use dynamic mapping in Elasticsearch (version 1.1) to persist an object. I have pre-created the Index, and I am using the Post api to index the object as follows

PUT /testprecreatedindex/NotCreatedMapping/Id1?version=3155378975111111119&version_type=external
{
   "title": "Test Blog",
   "Id": "Id1"
}

Response from elasticsearch in Sense (0.8.10)

{
   "_index": "testprecreatedindex",
   "_type": "NotCreatedMapping",
   "_id": "Id1",
   "_version": 3155378975111111000,
   "created": true
}

I am intentionally giving version as DateTime.MaxValue.Ticks as it is less than (2^63)-1 limit of elasticsearch. Still the result indicate that the version got truncated or round off.

Any clues to what I am doing wrong here?

ankitk
  • 458
  • 3
  • 12

1 Answers1

1

The rounding off is an artifact related to SENSE implementation more precisely way numbers are represented by Javascript which has a precision of 53 bits

The version data should have been stored properly in elasticsearch .

You can verify via a command line curl query.

curl -XGET 'http://localhost:9200/testprecreatedindex/NotCreatedMapping/Id1'
Community
  • 1
  • 1
keety
  • 17,231
  • 4
  • 51
  • 56