Open ended range query


(Nitish Sharma) #1

Hi,
Are there any wildcards available for (numeric) range queries in ES? In
particular, I am looking to run range queries like - {"lt":"*",
"gte":"2012-04-30"}.

Cheers
Nitish


(David Pilato) #2

I don't think that lt is mandatory. Just try to omit it !

HTH
David :wink:
Twitter : @dadoonet / @elasticsearchfr

Le 1 mai 2012 à 18:20, Nitish Sharma sharmanitishdutt@gmail.com a écrit :

Hi,
Are there any wildcards available for (numeric) range queries in ES? In particular, I am looking to run range queries like - {"lt":"*", "gte":"2012-04-30"}.

Cheers
Nitish


(Nitish Sharma) #3

Hi David,
Yeah, its not necessary. I figured it out.
Since I am assigning these ranges based on user inputs, what if user wants
to search in all the documents. I believe ES currently doesnt support
{"lt":"", "gte":""}.
Any (elegant) workaround for that? I figured using something like
{"lt":}, but that would mean completely omitting gte field
which is not possible.

Cheers
Nitish

On Tuesday, May 1, 2012 8:13:00 PM UTC+2, David Pilato wrote:

I don't think that lt is mandatory. Just try to omit it !

HTH
David :wink:
Twitter : @dadoonet / @elasticsearchfr

Le 1 mai 2012 à 18:20, Nitish Sharma sharmanitishdutt@gmail.com a écrit
:

Hi,
Are there any wildcards available for (numeric) range queries in ES? In
particular, I am looking to run range queries like - {"lt":"*",
"gte":"2012-04-30"}.

Cheers
Nitish


(Shay Banon) #4

If the user want to search on all ranges, then just omit the range
query/filter...

On Tue, May 1, 2012 at 11:13 PM, Nitish Sharma
sharmanitishdutt@gmail.comwrote:

Hi David,
Yeah, its not necessary. I figured it out.
Since I am assigning these ranges based on user inputs, what if user wants
to search in all the documents. I believe ES currently doesnt support
{"lt":"", "gte":""}.
Any (elegant) workaround for that? I figured using something like
{"lt":}, but that would mean completely omitting gte field
which is not possible.

Cheers
Nitish

On Tuesday, May 1, 2012 8:13:00 PM UTC+2, David Pilato wrote:

I don't think that lt is mandatory. Just try to omit it !

HTH
David :wink:
Twitter : @dadoonet / @elasticsearchfr

Le 1 mai 2012 à 18:20, Nitish Sharma sharmanitishdutt@gmail.com a
écrit :

Hi,
Are there any wildcards available for (numeric) range queries in ES? In
particular, I am looking to run range queries like - {"lt":"*",
"gte":"2012-04-30"}.

Cheers
Nitish


(system) #5