# External version does not behave per documentation

**URL:** https://discuss.elastic.co/t/external-version-does-not-behave-per-documentation/7997
**Category:** Elasticsearch
**Created:** [June 6, 2012, 6:51pm UTC](https://discuss.elastic.co/t/external-version-does-not-behave-per-documentation/7997 "2012-06-06T18:51:37Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![aaron](https://avatars.discourse-cdn.com/v4/letter/a/e19adc/32.png) [@aaron](https://discuss.elastic.co/u/aaron)
#### Post date: [June 6, 2012, 6:51pm UTC](https://discuss.elastic.co/t/external-version-does-not-behave-per-documentation/7997/1 "2012-06-06T18:51:37Z")

</div>

From elasticsearch website:

When using the external version type, instead of checking for a matching  
version number, the system checks to see if the version number passed to  
the index request is greater than or equal to the version of the currently  
stored document. If true, the document will be indexed and the new version  
number used. If the value provided is lower than the stored document’s  
version number, a version conflict will occur and the index operation will  
fail.

However, the behavior of elasticsearch actually is to fail if the provided  
external version is the _same_ as the existing version.

Is this a bug in the documentation, or in the code? (Or in my perception?)

---

<div class="post-metadata">

### Author: ![Tanguy1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tanguy1/32/1749_2.png) [@Tanguy1](https://discuss.elastic.co/u/Tanguy1)
#### Post date: [June 7, 2012, 7:19am UTC](https://discuss.elastic.co/t/external-version-does-not-behave-per-documentation/7997/2 "2012-06-07T07:19:07Z")

</div>

Hi,

I made a simple unit test last week on Version numbers:  
[https://github.com/tlrx/elasticsearch-test/blob/master/src/test/java/fr/tlrx/elasticsearch/samples/core/VersionTest.java](https://github.com/tlrx/elasticsearch-test/blob/master/src/test/java/fr/tlrx/elasticsearch/samples/core/VersionTest.java)

And it works as documented with elasticssearch 0.19.4.

Which version of es are you using?

-- Tanguy

Le mercredi 6 juin 2012 20:51:37 UTC+2, aaron a écrit :

> From elasticsearch website:
> 
> When using the external version type, instead of checking for a matching  
> version number, the system checks to see if the version number passed to  
> the index request is greater than or equal to the version of the currently  
> stored document. If true, the document will be indexed and the new  
> version number used. If the value provided is lower than the stored  
> document’s version number, a version conflict will occur and the index  
> operation will fail.
> 
> However, the behavior of elasticsearch actually is to fail if the provided  
> external version is the _same_ as the existing version.
> 
> Is this a bug in the documentation, or in the code? (Or in my perception?)

---

<div class="post-metadata">

### Author: ![Owen\_Butler\_2](https://avatars.discourse-cdn.com/v4/letter/o/b19c9b/32.png) [@Owen\_Butler\_2](https://discuss.elastic.co/u/Owen_Butler_2)
#### Post date: [June 7, 2012, 12:29pm UTC](https://discuss.elastic.co/t/external-version-does-not-behave-per-documentation/7997/3 "2012-06-07T12:29:10Z")

</div>

I believe this is a bug in the documentation. ES has always (as far as I  
remember) thrown a version conflict exception if the version provided is  
equal.

Here is a pull request to amend the documentation:

[https://github.com/elasticsearch/elasticsearch.github.com/pull/157](https://github.com/elasticsearch/elasticsearch.github.com/pull/157)

Owen Butler

On Thursday, June 7, 2012 4:51:37 AM UTC+10, aaron wrote:

> From elasticsearch website:
> 
> When using the external version type, instead of checking for a matching  
> version number, the system checks to see if the version number passed to  
> the index request is greater than or equal to the version of the currently  
> stored document. If true, the document will be indexed and the new  
> version number used. If the value provided is lower than the stored  
> document’s version number, a version conflict will occur and the index  
> operation will fail.
> 
> However, the behavior of elasticsearch actually is to fail if the provided  
> external version is the _same_ as the existing version.
> 
> Is this a bug in the documentation, or in the code? (Or in my perception?)

---

<div class="post-metadata">

### Author: ![Tanguy1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tanguy1/32/1749_2.png) [@Tanguy1](https://discuss.elastic.co/u/Tanguy1)
#### Post date: [June 7, 2012, 2:00pm UTC](https://discuss.elastic.co/t/external-version-does-not-behave-per-documentation/7997/4 "2012-06-07T14:00:39Z")

</div>

Owen is right, is a bug in doc.

(and my test was wrong)

-- Tanguy

Le jeudi 7 juin 2012 14:29:10 UTC+2, Owen Butler a écrit :

> I believe this is a bug in the documentation. ES has always (as far as I  
> remember) thrown a version conflict exception if the version provided is  
> equal.
> 
> Here is a pull request to amend the documentation:
> 
> [https://github.com/elasticsearch/elasticsearch.github.com/pull/157](https://github.com/elasticsearch/elasticsearch.github.com/pull/157)
> 
> Owen Butler
> 
> On Thursday, June 7, 2012 4:51:37 AM UTC+10, aaron wrote:
> 
> > From elasticsearch website:
> > 
> > When using the external version type, instead of checking for a matching  
> > version number, the system checks to see if the version number passed to  
> > the index request is greater than or equal to the version of the currently  
> > stored document. If true, the document will be indexed and the new  
> > version number used. If the value provided is lower than the stored  
> > document’s version number, a version conflict will occur and the index  
> > operation will fail.
> > 
> > However, the behavior of elasticsearch actually is to fail if the  
> > provided external version is the _same_ as the existing version.
> > 
> > Is this a bug in the documentation, or in the code? (Or in my perception?)

Le jeudi 7 juin 2012 14:29:10 UTC+2, Owen Butler a écrit :

> I believe this is a bug in the documentation. ES has always (as far as I  
> remember) thrown a version conflict exception if the version provided is  
> equal.
> 
> Here is a pull request to amend the documentation:
> 
> [https://github.com/elasticsearch/elasticsearch.github.com/pull/157](https://github.com/elasticsearch/elasticsearch.github.com/pull/157)
> 
> Owen Butler
> 
> On Thursday, June 7, 2012 4:51:37 AM UTC+10, aaron wrote:
> 
> > From elasticsearch website:
> > 
> > When using the external version type, instead of checking for a matching  
> > version number, the system checks to see if the version number passed to  
> > the index request is greater than or equal to the version of the currently  
> > stored document. If true, the document will be indexed and the new  
> > version number used. If the value provided is lower than the stored  
> > document’s version number, a version conflict will occur and the index  
> > operation will fail.
> > 
> > However, the behavior of elasticsearch actually is to fail if the  
> > provided external version is the _same_ as the existing version.
> > 
> > Is this a bug in the documentation, or in the code? (Or in my perception?)

---

<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 6, 2017, 3:25am UTC](https://discuss.elastic.co/t/external-version-does-not-behave-per-documentation/7997/5 "2017-07-06T03:25:22Z")

</div>


