Hi,
I need to exclude some documents of my resultset considering dates
period.
My search engine is for apartments rental, so I would like to exclude
from resultset, the apartments that are allready booked for the
considered period.
My example:
apartments data in my index:
apart_id: 1
name: Chinois
sleepings: 5
rooms: 2
city_id: 2
district: Opéra
facilities: [
Climatisation
Internet
Parking
]
elevator: 0
is_available_to_rent: 1
periods: [
{
start_date: 2013-09-04
end_date: 2013-09-06
apartment_id: 1
}
{
start_date: 2013-09-07
end_date: 2013-09-10
apartment_id: 1
}
]
apart_id: 2
name: Anglais
sleepings: 3
rooms: 2
city_id: 2
district: Opéra
facilities: [
Climatisation
Internet
Parking
]
elevator: 0
is_available_to_rent: 1
periods: [
{
start_date: 2013-05-13
end_date: 2013-05-17
apartment_id: 1
}
{
start_date: 2013-09-07
end_date: 2013-09-10
apartment_id: 1
}
]
I would like to get only the first apartment in my resultset (e.g.
exclude the first period of the second apartment)
For example, if I search apartment that is available for the period
between 2013-05-10 and 2013-05-15, the second should not match because
it has a period that is overlaped by the search period.
I try bool query with a range query (or range filter), but it does not
work...
--
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.
For more options, visit https://groups.google.com/groups/opt_out.