Range for id

Hello
My need is to find the documents which _id > "50792fa924cc1e5028003fc0"

I'm trying to, for example:
{"query": {"range": {"_uid": {"gt": "50792fa924cc1e5028003fc0"}}}}

and ...

{"query": {"range": {"_id": {"gt": "50792fa924cc1e5028003fc0"}}}}

no result

"query": {"term": {"_id": "50792fa924cc1e5028003fc0"}}
works well
and
"sort": [{"_uid": "asc"}]
works well

id - hexadecimal id of Mongo

Any clue ?

Thank you

sorry for my english

Hi sada,

the _id field is not indexed by default (only as part of the _uid field which is a combi of both _id & _type - which is the reason why using _uid in your queries won't help much in your case). You can configure it to be indexed in the mapping by defining something like:

"_id" : { "index" : "not_analyzed" }

cheers,
Uri

--
Uri Boness | Founder | Elasticsearch | www.elasticsearch.com | +31 20 486 2036

On Sunday, November 18, 2012 at 8:41 PM, sada wrote:

Hello
My need is to find the documents which _id > "50792fa924cc1e5028003fc0"

I'm trying to, for example:
{"query": {"range": {"_uid": {"gt": "50792fa924cc1e5028003fc0"}}}}

and ...

{"query": {"range": {"_id": {"gt": "50792fa924cc1e5028003fc0"}}}}

no result

"query": {"term": {"_id": "50792fa924cc1e5028003fc0"}}
works well
and
"sort": [{"_uid": "asc"}]
works well

id - hexadecimal id of Mongo

Any clue ?

Thank you

sorry for my english

--

--

Thank you for the quick response