# Numeric range quey or filter in an array field - possible or not?

**URL:** <https://discuss.elastic.co/t/numeric-range-quey-or-filter-in-an-array-field-possible-or-not/14053>\
**Category:** Elasticsearch\
**Created:** [October 22, 2013, 8:49am UTC](https://discuss.elastic.co/t/numeric-range-quey-or-filter-in-an-array-field-possible-or-not/14053 "2013-10-22T08:49:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jens\_Christian\_Groh](https://avatars.discourse-cdn.com/v4/letter/j/48db29/32.png) [@Jens\_Christian\_Groh](https://discuss.elastic.co/u/Jens_Christian_Groh)\
**Post date:** [October 22, 2013, 8:49am UTC](https://discuss.elastic.co/t/numeric-range-quey-or-filter-in-an-array-field-possible-or-not/14053/1 "2013-10-22T08:49:59Z")

</div>

Hello together,

is an range query or filter possible if the field is an array?

Index looks like:

{  
"name":"test1",  
"numbers":[  
11,23,13,16,17,23.6  
]  
},  
{  
"name":"test2",  
"numbers":[  
1,2,3,4,5,6,7,8,8.9,9.1,9.4  
]  
},  
{  
"name":"test3",  
"numbers":[{  
101,230,150,200  
]  
}

Is it possible to do a query like this:

{  
"query" : {  
"range" : {  
"numbers" : {  
"gt" : 10,  
"lt" : 23.9  
}  
}  
}  
}

I tried it with a few tests but never got a result. So it would be nice to  
know, if somebody has a clue if this works and i just made some mistakes.  
Thanks

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [October 22, 2013, 9:00am UTC](https://discuss.elastic.co/t/numeric-range-quey-or-filter-in-an-array-field-possible-or-not/14053/2 "2013-10-22T09:00:41Z")

</div>

Would be nice if you could provide a full curl recreation as explained in help: [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help/)

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 22 oct. 2013 à 10:49, Jens Christian Groh [groh@dtis.eu](mailto:groh@dtis.eu) a écrit :

> Hello together,
> 
> is an range query or filter possible if the field is an array?
> 
> Index looks like:
> 
> {  
> "name":"test1",  
> "numbers":[  
> 11,23,13,16,17,23.6  
> ]  
> },  
> {  
> "name":"test2",  
> "numbers":[  
> 1,2,3,4,5,6,7,8,8.9,9.1,9.4  
> ]  
> },  
> {  
> "name":"test3",  
> "numbers":[{  
> 101,230,150,200  
> ]  
> }
> 
> Is it possible to do a query like this:
> 
> {  
> "query" : {  
> "range" : {  
> "numbers" : {  
> "gt" : 10,  
> "lt" : 23.9  
> }  
> }  
> }  
> }
> 
> I tried it with a few tests but never got a result. So it would be nice to know, if somebody has a clue if this works and i just made some mistakes.  
> Thanks
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [October 22, 2013, 12:09pm UTC](https://discuss.elastic.co/t/numeric-range-quey-or-filter-in-an-array-field-possible-or-not/14053/3 "2013-10-22T12:09:22Z")

</div>

Check this example [https://gist.github.com/jprante/7099463](https://gist.github.com/jprante/7099463) - it works here.

Jörg

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:11am UTC](https://discuss.elastic.co/t/numeric-range-quey-or-filter-in-an-array-field-possible-or-not/14053/4 "2017-07-06T02:11:11Z")

</div>


