Query on version?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Query on version?

Mark Waddle
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
Reply | Threaded
Open this post in threaded view
|

Re: Query on version?

Ivan Brusic
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 <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

Re: Query on version?

kimchy
Administrator
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 <[hidden email]> wrote:

Reply | Threaded
Open this post in threaded view
|

Re: Query on version?

Mark Waddle
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
Reply | Threaded
Open this post in threaded view
|

Re: Query on version?

kimchy
Administrator
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