# Nested terms aggregation performance

**URL:** <https://discuss.elastic.co/t/nested-terms-aggregation-performance/260446>\
**Category:** Elasticsearch\
**Created:** [January 7, 2021, 1:42pm UTC](https://discuss.elastic.co/t/nested-terms-aggregation-performance/260446 "2021-01-07T13:42:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shusson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shusson/32/81893_2.png) [@shusson](https://discuss.elastic.co/u/shusson)\
**Post date:** [January 7, 2021, 1:42pm UTC](https://discuss.elastic.co/t/nested-terms-aggregation-performance/260446/1 "2021-01-07T13:42:47Z")

</div>

I'm trying to optimize nested term aggregations for an autocomplete use case. More info on the query and mapping here: [https://stackoverflow.com/questions/65613335/improve-performance-of-a-nested-term-aggregation](https://stackoverflow.com/questions/65613335/improve-performance-of-a-nested-term-aggregation).

Based on [https://github.com/elastic/elasticsearch/issues/22912#issuecomment-277189389](https://github.com/elastic/elasticsearch/issues/22912#issuecomment-277189389) it seems like it is recommended to create a separate index for autocomplete on search terms which may be duplicated across documents. Is that still the case?

---

<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:** [February 4, 2021, 1:43pm UTC](https://discuss.elastic.co/t/nested-terms-aggregation-performance/260446/2 "2021-02-04T13:43:04Z")

</div>

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