Return _version with query hits

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?

clint

--

--