How to search documents by version?
Unfortunately, you cannot query or filter by _version - the problem is that that field is not indexed, so queries and filters cannot access it:
http://elasticsearch-users.115913.n3.nabble.com/Can-i-filter-query-by-version-td4044331.html
Try using version
Returns a version for each search hit.
{
"version": true,
"query" : {
"term" : { "user" : "kimchy" }
}
}
you can search like normal and set version as true and it will return you count of all the versions for each document:
GET indextest/original/_search?pretty=true
{
"version": true
}