# Terms stats facet - Additional information

**URL:** <https://discuss.elastic.co/t/terms-stats-facet-additional-information/12047>\
**Category:** Elasticsearch\
**Created:** [May 21, 2013, 7:20am UTC](https://discuss.elastic.co/t/terms-stats-facet-additional-information/12047 "2013-05-21T07:20:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dilshan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dilshan/32/2364_2.png) [@dilshan](https://discuss.elastic.co/u/dilshan)\
**Post date:** [May 21, 2013, 7:20am UTC](https://discuss.elastic.co/t/terms-stats-facet-additional-information/12047/1 "2013-05-21T07:20:57Z")

</div>

Hi,

In the current implementation of terms stats facet[http://www.elasticsearch.org/guide/reference/api/search/facets/terms-stats-facet/](http://www.elasticsearch.org/guide/reference/api/search/facets/terms-stats-facet/),  
it returns following information about the term.

"term" : 4728,  
"count" : 5,  
"total\_count" : 5,  
"min" : 0.8173637390136719,  
"max" : 1.0706526041030884,  
"total" : 4.715699732303619,  
"mean" : 0.9431399464607239

Can we get more information about these terms? I'm looking for info like,

1. ids of matching docs in an array or so.
2. some field value of matching docs in array or so.

Is there a possibility of doing such a thing? (May be using a facet other  
than terms-stats)

Thanks,  
Dilshan.

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [May 22, 2013, 4:46am UTC](https://discuss.elastic.co/t/terms-stats-facet-additional-information/12047/2 "2013-05-22T04:46:26Z")

</div>

What you are probably looking for is field collapsing, which is a popular  
(but still not implemented request) feature:

> <https://github.com/elastic/elasticsearch/issues/256>
>
> Ability to collapse on a field. For example, I want the most relevant result fro…m all different report types. Or similarly, the most recent result of each report type. Or maybe, I want to de-dup on headline. 
> 
> So, the sort order would dictate which one from the group is returned. Similar to what is discussed here:
> http://blog.jteam.nl/2009/10/20/result-grouping-field-collapsing-with-solr/
> 
> From my understanding, it seems that in order for field collapsing to be efficient, the result set must be relatively small.
> 
> This is also referred to as "Combine" on some other search products.

--  
Ivan

On Tue, May 21, 2013 at 12:20 AM, dilshan [dilshan@calcey.com](mailto:dilshan@calcey.com) wrote:

> Hi,
> 
> In the current implementation of terms stats facet[http://www.elasticsearch.org/guide/reference/api/search/facets/terms-stats-facet/](http://www.elasticsearch.org/guide/reference/api/search/facets/terms-stats-facet/),  
> it returns following information about the term.
> 
> "term" : 4728,  
> "count" : 5,  
> "total\_count" : 5,  
> "min" : 0.8173637390136719,  
> "max" : 1.0706526041030884,  
> "total" : 4.715699732303619,  
> "mean" : 0.9431399464607239
> 
> Can we get more information about these terms? I'm looking for info like,
> 
> 1. ids of matching docs in an array or so.
> 2. some field value of matching docs in array or so.
> 
> Is there a possibility of doing such a thing? (May be using a facet other  
> than terms-stats)
> 
> Thanks,  
> Dilshan.
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [May 23, 2013, 10:09am UTC](https://discuss.elastic.co/t/terms-stats-facet-additional-information/12047/3 "2013-05-23T10:09:11Z")

</div>

What you can do is:

1. Run a query to generate facets
2. Use multi-search to pull back the docs for each facet result

clint

On 22 May 2013 06:46, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:

> What you are probably looking for is field collapsing, which is a popular  
> (but still not implemented request) feature:  
> [Field Collapsing/Combining · Issue #256 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/256)
> 
> --  
> Ivan
> 
> On Tue, May 21, 2013 at 12:20 AM, dilshan [dilshan@calcey.com](mailto:dilshan@calcey.com) wrote:
> 
> > Hi,
> > 
> > In the current implementation of terms stats facet[http://www.elasticsearch.org/guide/reference/api/search/facets/terms-stats-facet/](http://www.elasticsearch.org/guide/reference/api/search/facets/terms-stats-facet/),  
> > it returns following information about the term.
> > 
> > "term" : 4728,  
> > "count" : 5,  
> > "total\_count" : 5,  
> > "min" : 0.8173637390136719,  
> > "max" : 1.0706526041030884,  
> > "total" : 4.715699732303619,  
> > "mean" : 0.9431399464607239
> > 
> > Can we get more information about these terms? I'm looking for info like,
> > 
> > 1. ids of matching docs in an array or so.
> > 2. some field value of matching docs in array or so.
> > 
> > Is there a possibility of doing such a thing? (May be using a facet other  
> > than terms-stats)
> > 
> > Thanks,  
> > Dilshan.
> > 
> > --  
> > 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).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:35am UTC](https://discuss.elastic.co/t/terms-stats-facet-additional-information/12047/4 "2017-07-06T02:35:11Z")

</div>


