# Range filter in array of objects

**URL:** <https://discuss.elastic.co/t/range-filter-in-array-of-objects/18478>\
**Category:** Elasticsearch\
**Created:** [July 4, 2014, 7:34am UTC](https://discuss.elastic.co/t/range-filter-in-array-of-objects/18478 "2014-07-04T07:34:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jcl/32/6605_2.png) [@jcl](https://discuss.elastic.co/u/jcl)\
**Post date:** [July 4, 2014, 7:34am UTC](https://discuss.elastic.co/t/range-filter-in-array-of-objects/18478/1 "2014-07-04T07:34:30Z")

</div>

Hi there,

I know how to filter my queries with range filters but i wanted something  
more complicated and can't find the way to do it.  
Let me explain:

I have a set of objects :

{  
id: "123456789"  
....  
bookings: [  
{  
id: "12345678",  
start: timestamp\_1,  
end: timestamp\_2  
},  
{  
id: "12345678",  
start: timestamp\_3,  
end: timestamp\_4  
}  
...  
]  
}

And i want to get elements not booked for selected dates (timestamps as  
well) so i have to check ranges of each booking.

Could someone help on this issue ?

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/416651d7-cc02-4e67-984c-c4a0c1e870b1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/416651d7-cc02-4e67-984c-c4a0c1e870b1%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jcl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jcl/32/6605_2.png) [@jcl](https://discuss.elastic.co/u/jcl)\
**Post date:** [July 4, 2014, 9:52am UTC](https://discuss.elastic.co/t/range-filter-in-array-of-objects/18478/2 "2014-07-04T09:52:24Z")

</div>

I found a way with an "or" filter and some "and" filters but it's not as  
beautiful as i like it would 😉

I'll take any better way...

Le vendredi 4 juillet 2014 09:34:30 UTC+2, [j...@appiway.com](mailto:j...@appiway.com) a écrit :

> Hi there,
> 
> I know how to filter my queries with range filters but i wanted something  
> more complicated and can't find the way to do it.  
> Let me explain:
> 
> I have a set of objects :
> 
> {  
> id: "123456789"  
> ....  
> bookings: [  
> {  
> id: "12345678",  
> start: timestamp\_1,  
> end: timestamp\_2  
> },  
> {  
> id: "12345678",  
> start: timestamp\_3,  
> end: timestamp\_4  
> }  
> ...  
> ]  
> }
> 
> And i want to get elements not booked for selected dates (timestamps as  
> well) so i have to check ranges of each booking.
> 
> Could someone help on this issue ?

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b05e720b-2456-4b31-bab7-c8e127a0acb4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b05e720b-2456-4b31-bab7-c8e127a0acb4%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![japel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/japel/32/9241_2.png) [@japel](https://discuss.elastic.co/u/japel)\
**Post date:** [September 30, 2016, 2:27pm UTC](https://discuss.elastic.co/t/range-filter-in-array-of-objects/18478/3 "2016-09-30T14:27:34Z")

</div>

Hey jcl,

would you share how you managed to accomplish this?

I'm also having problems to implement the same behavior

best regards

japel

---

<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 5, 2017, 10:15pm UTC](https://discuss.elastic.co/t/range-filter-in-array-of-objects/18478/4 "2017-07-05T22:15:47Z")

</div>


