# Open ended range query

**URL:** <https://discuss.elastic.co/t/open-ended-range-query/7525>\
**Category:** Elasticsearch\
**Created:** [May 1, 2012, 4:20pm UTC](https://discuss.elastic.co/t/open-ended-range-query/7525 "2012-05-01T16:20:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nitish\_Sharma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nitish_sharma/32/2626_2.png) [@Nitish\_Sharma](https://discuss.elastic.co/u/Nitish_Sharma)\
**Post date:** [May 1, 2012, 4:20pm UTC](https://discuss.elastic.co/t/open-ended-range-query/7525/1 "2012-05-01T16:20:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 1, 2012, 6:13pm UTC](https://discuss.elastic.co/t/open-ended-range-query/7525/2 "2012-05-01T18:13:00Z")

</div>

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

HTH  
David 😉  
Twitter : @dadoonet / @elasticsearchfr

Le 1 mai 2012 à 18:20, Nitish Sharma [sharmanitishdutt@gmail.com](mailto: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

---

<div class="post-metadata">

**Author:** ![Nitish\_Sharma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nitish_sharma/32/2626_2.png) [@Nitish\_Sharma](https://discuss.elastic.co/u/Nitish_Sharma)\
**Post date:** [May 1, 2012, 8:13pm UTC](https://discuss.elastic.co/t/open-ended-range-query/7525/3 "2012-05-01T20:13:56Z")

</div>

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 😉  
> Twitter : @dadoonet / @elasticsearchfr
> 
> Le 1 mai 2012 à 18:20, Nitish Sharma [sharmanitishdutt@gmail.com](mailto: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

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 2, 2012, 4:31pm UTC](https://discuss.elastic.co/t/open-ended-range-query/7525/4 "2012-05-02T16:31:57Z")

</div>

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.com](mailto:sharmanitishdutt@gmail.com)wrote:

> 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 😉  
> > Twitter : @dadoonet / @elasticsearchfr
> > 
> > Le 1 mai 2012 à 18:20, Nitish Sharma [sharmanitishdutt@gmail.com](mailto: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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:30am UTC](https://discuss.elastic.co/t/open-ended-range-query/7525/5 "2017-07-06T03:30:18Z")

</div>


