How can I add additional parameters in aggregation?

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/b9456488-805b-4c5e-ad16-12cd9a0feaf2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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