range filter in array of objects

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
jcl
Reply | Threaded
Open this post in threaded view
|

range filter in array of objects

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

Re: range filter in array of objects

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