External version does not behave per documentation

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?)

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

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?)

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

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?)

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

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

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?)