# Negative version number on java API, positive on curl, re-index creates duplicate (same id, different shard) document

**URL:** <https://discuss.elastic.co/t/negative-version-number-on-java-api-positive-on-curl-re-index-creates-duplicate-same-id-different-shard-document/56642>\
**Category:** Elasticsearch\
**Created:** [July 28, 2016, 3:06pm UTC](https://discuss.elastic.co/t/negative-version-number-on-java-api-positive-on-curl-re-index-creates-duplicate-same-id-different-shard-document/56642 "2016-07-28T15:06:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ndtreviv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ndtreviv/32/22494_2.png) [@ndtreviv](https://discuss.elastic.co/u/ndtreviv)\
**Post date:** [July 28, 2016, 3:06pm UTC](https://discuss.elastic.co/t/negative-version-number-on-java-api-positive-on-curl-re-index-creates-duplicate-same-id-different-shard-document/56642/1 "2016-07-28T15:06:00Z")

</div>

I'm restoring data from an s3 bucketed snapshot into elasticsearch:1.7.3, and the version numbers of all the documents are negative.

I have another problem (ref: [Write consistency on a single node cluster - #4 by javanna](https://discuss.elastic.co/t/write-consistency-on-a-single-node-cluster/56542/4)) which I think this may be contributing to.

The elasticsearch docs state that version should be a positive number:

> That version number is a positive number between 1 and 2 63-1 (inclusive)

- [Elasticsearch Versioning Support | Elastic Blog](https://www.elastic.co/blog/elasticsearch-versioning-support)

What's happening? Is this actually allowed? Could it be contributing to my problem?

---

<div class="post-metadata">

**Author:** ![ndtreviv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ndtreviv/32/22494_2.png) [@ndtreviv](https://discuss.elastic.co/u/ndtreviv)\
**Post date:** [July 29, 2016, 9:32am UTC](https://discuss.elastic.co/t/negative-version-number-on-java-api-positive-on-curl-re-index-creates-duplicate-same-id-different-shard-document/56642/3 "2016-07-29T09:32:21Z")

</div>

Actually, it turned out I was getting a negative number on the java API because I wasn't asking for version in the query. D'oh! Still indexes a duplicate document on a different shard, however...

---

<div class="post-metadata">

**Author:** ![ndtreviv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ndtreviv/32/22494_2.png) [@ndtreviv](https://discuss.elastic.co/u/ndtreviv)\
**Post date:** [July 29, 2016, 9:46am UTC](https://discuss.elastic.co/t/negative-version-number-on-java-api-positive-on-curl-re-index-creates-duplicate-same-id-different-shard-document/56642/4 "2016-07-29T09:46:14Z")

</div>

Ignore all of this. See [Write consistency on a single node cluster](https://discuss.elastic.co/t/write-consistency-on-a-single-node-cluster/56542/11) for why.

---

<div class="post-metadata">

**Author:** ![Glen\_Smith](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/glen_smith/32/111656_2.png) [@Glen\_Smith](https://discuss.elastic.co/u/Glen_Smith)\
**Post date:** [July 30, 2016, 9:54pm UTC](https://discuss.elastic.co/t/negative-version-number-on-java-api-positive-on-curl-re-index-creates-duplicate-same-id-different-shard-document/56642/5 "2016-07-30T21:54:35Z")

</div>



---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 10:31pm UTC](https://discuss.elastic.co/t/negative-version-number-on-java-api-positive-on-curl-re-index-creates-duplicate-same-id-different-shard-document/56642/6 "2017-07-05T22:31:49Z")

</div>


