Setup: Elasticsearch v.5.6
Document field called availabilities is the one to perform aggregation on.
The desired aggregation is departure_dates.
Departure date can be calculated as follows: availabilities.arrival_date + availabilities.nights.
I would like to apply mnd field filter to the aggregation also.
Document example:
{
"availabilities": [
{
"nights": 7,
"arrival_dates": [
"2019-08-24",
"2019-08-25"
],
"mnd": [
201908
]
},
{
"nights": 5,
"arrival_dates": [
"2019-08-25"
],
"mnd": [
201908
]
},
{
"nights": 10,
"arrival_dates": [
"2019-09-05"
],
"mnd": [
201909
]
}
]
}