We have multiple hotels and each hotel has diffirent price for different date which is also device specific. Now, if user search for a date range(11-04-2016 to 13-04-2016) then we need to get:
Hotel sorted against thier aggregate prices for the given dates for each device type.
I had kept prices, availability & dates within nested objects. Here are the gists for my current mappings, input data output & search query:
Aggregation Query & output:
Please help me to use aggregation to solve this problem or suggest any other solution for this.