# Elastichsearch Price Aggregations on multi Nested Objects

**URL:** https://discuss.elastic.co/t/elastichsearch-price-aggregations-on-multi-nested-objects/47355
**Category:** Elasticsearch
**Created:** [April 14, 2016, 7:56am UTC](https://discuss.elastic.co/t/elastichsearch-price-aggregations-on-multi-nested-objects/47355 "2016-04-14T07:56:02Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Anushank\_Lal](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@Anushank\_Lal](https://discuss.elastic.co/u/Anushank_Lal)
#### Post date: [April 14, 2016, 7:56am UTC](https://discuss.elastic.co/t/elastichsearch-price-aggregations-on-multi-nested-objects/47355/1 "2016-04-14T07:56:03Z")

</div>

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:

> <https://gist.github.com/Anushank-lal/d8d67ecf0776bcf3b6aab36f800c8ab8>
>
> There are more than three files. show original

Aggregation Query & output:

> <https://gist.github.com/Anushank-lal/60e051938260c45040dad8399e3583f6>
>
> There are more than three files. show original

Please help me to use aggregation to solve this problem or suggest any other solution for this.

Thanks,  
Anushank

---

<div class="post-metadata">

### Author: ![talk2cshah](https://avatars.discourse-cdn.com/v4/letter/t/8e7dd6/32.png) [@talk2cshah](https://discuss.elastic.co/u/talk2cshah)
#### Post date: [April 14, 2016, 8:03am UTC](https://discuss.elastic.co/t/elastichsearch-price-aggregations-on-multi-nested-objects/47355/2 "2016-04-14T08:03:04Z")

</div>

The problem statement is not clear. kindly rephrase with clarity and add sample input data and expected output format.

---

<div class="post-metadata">

### Author: ![Anushank\_Lal](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@Anushank\_Lal](https://discuss.elastic.co/u/Anushank_Lal)
#### Post date: [April 14, 2016, 9:50am UTC](https://discuss.elastic.co/t/elastichsearch-price-aggregations-on-multi-nested-objects/47355/3 "2016-04-14T09:50:38Z")

</div>

Hi, I had rephased the problem & also added sample input & output in gist.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 5, 2017, 10:59pm UTC](https://discuss.elastic.co/t/elastichsearch-price-aggregations-on-multi-nested-objects/47355/4 "2017-07-05T22:59:21Z")

</div>


