Range filter in array of objects


(jcl) #1

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.
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) #2

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

I'll take any better way...

Le vendredi 4 juillet 2014 09:34:30 UTC+2, 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.
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.


(Japel) #3

Hey jcl,

would you share how you managed to accomplish this?

I'm also having problems to implement the same behavior

best regards

japel


(system) #4