Query on version?

Is it possible to query for documents that have a specific version number,
or even better with a range?

This seems to hit all docs
http://localhost:9200/patent/grant/_search?q=version:[2+TO+*]&pretty=true&version=true

And these hit none
http://localhost:9200/patent/grant/_search?q=_version:[2+TO+*]&pretty=true&version=true
http://localhost:9200/patent/grant/_search?q=version:2&pretty=true&version=true
http://localhost:9200/patent/grant/_search?q=_version:2&pretty=true&version=true

I know I have at least a handful of docs with version of 2.

Thanks,

Mark

It is not possible to query on the version number. I asked the same
question a while back.

--
Ivan

On Fri, Feb 10, 2012 at 10:49 PM, Mark Waddle mark@markwaddle.com wrote:

Is it possible to query for documents that have a specific version number,
or even better with a range?

This seems to hit all docs
http://localhost:9200/patent/grant/_search?q=version:[2+TO+*]&pretty=true&version=true

And these hit none
http://localhost:9200/patent/grant/_search?q=_version:[2+TO+*]&pretty=true&version=true
http://localhost:9200/patent/grant/_search?q=version:2&pretty=true&version=true
http://localhost:9200/patent/grant/_search?q=_version:2&pretty=true&version=true

I know I have at least a handful of docs with version of 2.

Thanks,

Mark

As Ivan pointed out, its not possible to do so. Why do you need it?

On Saturday, February 11, 2012 at 12:56 PM, Ivan Brusic wrote:

It is not possible to query on the version number. I asked the same
question a while back.

--
Ivan

On Fri, Feb 10, 2012 at 10:49 PM, Mark Waddle <mark@markwaddle.com (mailto:mark@markwaddle.com)> wrote:

Is it possible to query for documents that have a specific version number,
or even better with a range?

This seems to hit all docs
http://localhost:9200/patent/grant/_search?q=version:[2+TO+*]&pretty=true&version=true

And these hit none
http://localhost:9200/patent/grant/_search?q=_version:[2+TO+*]&pretty=true&version=true
http://localhost:9200/patent/grant/_search?q=version:2&pretty=true&version=true
http://localhost:9200/patent/grant/_search?q=_version:2&pretty=true&version=true

I know I have at least a handful of docs with version of 2.

Thanks,

Mark

Thanks for the responses. I am ingesting a number of documents that have been published over time, some of which are republished. I was hoping I could query on version to see those that have been indexed (published) more than once. Maybe I can use the new indexing feature that allows using script to increment another field?

Mark

Yes, I see. The update might help, but it only updates, it doesn't index a fresh copy.

On Monday, February 13, 2012 at 10:27 AM, Mark Waddle wrote:

Thanks for the responses. I am ingesting a number of documents that have been published over time, some of which are republished. I was hoping I could query on version to see those that have been indexed (published) more than once. Maybe I can use the new indexing feature that allows using script to increment another field?

Mark