# How can I add additional parameters in aggregation?

**URL:** <https://discuss.elastic.co/t/how-can-i-add-additional-parameters-in-aggregation/21666>\
**Category:** Elasticsearch\
**Created:** [January 15, 2015, 5:43pm UTC](https://discuss.elastic.co/t/how-can-i-add-additional-parameters-in-aggregation/21666 "2015-01-15T17:43:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eylon\_Steiner](https://avatars.discourse-cdn.com/v4/letter/e/977dab/32.png) [@Eylon\_Steiner](https://discuss.elastic.co/u/Eylon_Steiner)\
**Post date:** [January 15, 2015, 5:43pm UTC](https://discuss.elastic.co/t/how-can-i-add-additional-parameters-in-aggregation/21666/1 "2015-01-15T17:43:43Z")

</div>

I have documents with id and name and title.  
I am making aggregation according name, but how can I get in the results  
also the name and title?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b9456488-805b-4c5e-ad16-12cd9a0feaf2%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b9456488-805b-4c5e-ad16-12cd9a0feaf2%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![oreno](https://avatars.discourse-cdn.com/v4/letter/o/b4bc9f/32.png) [@oreno](https://discuss.elastic.co/u/oreno)\
**Post date:** [January 16, 2015, 1:42am UTC](https://discuss.elastic.co/t/how-can-i-add-additional-parameters-in-aggregation/21666/2 "2015-01-16T01:42:59Z")

</div>

Hi Eylon,  
You can use a sub aggregation for the title. If there's no name with 2 titles, the sub title aggregation will always contain a single bucket for each name with the same count as you have now. So you can now also retrieve the title.  
In case there is a name with more then a single title, you'll get the aggregation for each combination.

Oren

---

<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 6, 2017, 12:38am UTC](https://discuss.elastic.co/t/how-can-i-add-additional-parameters-in-aggregation/21666/3 "2017-07-06T00:38:32Z")

</div>

Closed on July 6, 2017, 12:38am UTC


