# Nested aggregation of 7 documents takes 1 min

**URL:** <https://discuss.elastic.co/t/nested-aggregation-of-7-documents-takes-1-min/217823>\
**Category:** Elasticsearch\
**Created:** [February 4, 2020, 1:48pm UTC](https://discuss.elastic.co/t/nested-aggregation-of-7-documents-takes-1-min/217823 "2020-02-04T13:48:38Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![naoko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/naoko/32/11822_2.png) [@naoko](https://discuss.elastic.co/u/naoko)\
**Post date:** [February 4, 2020, 9:56pm UTC](https://discuss.elastic.co/t/nested-aggregation-of-7-documents-takes-1-min/217823/21 "2020-02-04T21:56:03Z")

</div>

Thank you for pointing that out. I've changed to `"script": "doc['start_time'].value.hour",` and now it completes in 5 seconds! Much improved acceptable speed. Thank you @Mark_Harwood so much for being patient with me.

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [February 4, 2020, 10:33pm UTC](https://discuss.elastic.co/t/nested-aggregation-of-7-documents-takes-1-min/217823/22 "2020-02-04T22:33:36Z")

</div>

Glad we resolved it!

---

<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:** [March 3, 2020, 10:40pm UTC](https://discuss.elastic.co/t/nested-aggregation-of-7-documents-takes-1-min/217823/23 "2020-03-03T22:40:23Z")

</div>

Closed on March 3, 2020, 10:40pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.

[Previous page](https://discuss.elastic.co/t/nested-aggregation-of-7-documents-takes-1-min/217823.md?page=1)
