Hm, I don't think that works as a general solution. If you're using sub-aggregations or a filter aggregation, the total for the entire search will be too high.
On Wed, Jul 16, 2014 at 10:01 AM, Itamar Syn-Hershko <[email protected]> wrote: > You get it from the search request that wraps the terms aggregation, under > total hits in the root of the response > > -- > > Itamar Syn-Hershko > http://code972.com | @synhershko <https://twitter.com/synhershko> > Freelance Developer & Consultant > Author of RavenDB in Action <http://manning.com/synhershko/> > > > On Wed, Jul 16, 2014 at 4:56 PM, Michael Sander <[email protected]> > wrote: > >> Hi, >> >> I've started using aggregations heavily to make nifty little pie charts >> like the one below. To generate the pie chart below, I ran a terms >> aggregation on a particular field which has entries such as Sterne, Fish, >> etc. However, the terms aggregation only returns a doc_count for each >> individual term, but I'd also like to know the total doc_count so that I >> can create another pie slice for "other." Is there any way to do this in a >> single aggregation call? >> >> Thanks, >> >> >> <https://lh6.googleusercontent.com/-QaE4hTZVH-s/U8aD-Hifq_I/AAAAAAAACTQ/jnCH4frOURk/s1600/pie.png> >> >> -- >> 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 [email protected]. >> >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/elasticsearch/3f2f9311-52ff-4917-9d50-a48635f60957%40googlegroups.com >> <https://groups.google.com/d/msgid/elasticsearch/3f2f9311-52ff-4917-9d50-a48635f60957%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > -- > You received this message because you are subscribed to a topic in the > Google Groups "elasticsearch" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/elasticsearch/OM6KSy88iEo/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZuzRTe48eGgm%2BweE%2BnkzhZTpc8wp0bZoCYbGvLeEkZS5Q%40mail.gmail.com > <https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZuzRTe48eGgm%2BweE%2BnkzhZTpc8wp0bZoCYbGvLeEkZS5Q%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAFa8q3aSX%3D6QmTK5Qw9NoQoaHMChgbSkaYBwfqwPePVHLQqnKw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
