I'm using the _version attribute to ensure a put to particular document id
only succeeds if the correct version is specified This works great except I
don't seem to be able to get elasticsearch to return the correct version
with query results.
I get one result for the query and the _id, _score, and _source field are
there as expected but the _version field that I would need to update with
the version check enabled is missing.
Am I doing something wrong or is this simply not supported?
On Fri, 2013-01-11 at 07:25 -0800, Jilles van Gurp wrote:
I'm using the _version attribute to ensure a put to particular
document id only succeeds if the correct version is specified This
works great except I don't seem to be able to get elasticsearch to
return the correct version with query results.
I'm sending this query:
{"query":{"term":{"accounts.provider_uid":"xxxx","accounts.provider":"xxxx"}},"from":0,"size":1,"fields":["_source","_id","_version","_score"]}
I get one result for the query and the _id, _score, and _source field
are there as expected but the _version field that I would need to
update with the version check enabled is missing.
Am I doing something wrong or is this simply not supported?
{"query":{"term":{"accounts.provider_uid":"xxxxxx","accounts.provider":"xxxxx"}},"from":0,"size":1,"version":true}
The queries are identical except for the position of the parameters.
On Friday, January 11, 2013 5:25:36 PM UTC+1, Clinton Gormley wrote:
On Fri, 2013-01-11 at 07:25 -0800, Jilles van Gurp wrote:
I'm using the _version attribute to ensure a put to particular
document id only succeeds if the correct version is specified This
works great except I don't seem to be able to get elasticsearch to
return the correct version with query results.
I get one result for the query and the _id, _score, and _source field
are there as expected but the _version field that I would need to
update with the version check enabled is missing.
Am I doing something wrong or is this simply not supported?
This turned out to not be a bug in ES, but the github issue did prompt me
to update my Java client to call SearchRequestBuilder.setVersion(true), and
now my SearchHit objects contain the version number! Thanks, Shay!
On Friday, January 11, 2013 10:25:53 AM UTC-5, Jilles van Gurp wrote:
I'm using the _version attribute to ensure a put to particular document id
only succeeds if the correct version is specified This works great except I
don't seem to be able to get elasticsearch to return the correct version
with query results.
I get one result for the query and the _id, _score, and _source field are
there as expected but the _version field that I would need to update with
the version check enabled is missing.
Am I doing something wrong or is this simply not supported?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.