# How to get "missing" and "other" stats when using "terms-stats" facet?

**URL:** <https://discuss.elastic.co/t/how-to-get-missing-and-other-stats-when-using-terms-stats-facet/10609>\
**Category:** Elasticsearch\
**Created:** [February 3, 2013, 7:34pm UTC](https://discuss.elastic.co/t/how-to-get-missing-and-other-stats-when-using-terms-stats-facet/10609 "2013-02-03T19:34:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![roytmana](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roytmana/32/44855_2.png) [@roytmana](https://discuss.elastic.co/u/roytmana)\
**Post date:** [February 3, 2013, 7:34pm UTC](https://discuss.elastic.co/t/how-to-get-missing-and-other-stats-when-using-terms-stats-facet/10609/1 "2013-02-03T19:34:14Z")

</div>

Hello I am developing some charting components using terms statistical  
faceting and I ran into a problem of not being able to account for  
"missing" (where term on which faceting is done is missing) or "other"  
(terms not fitting facet size setting and thus not calculated) values  
making my charts pretty meaningless since they do not operate on entire  
body of records

Is it possible to get "other" and "missing" total when using  
"terms-stats" similar to how "other" and "missing" count is provided when  
using "terms" facet?

--  
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:** ![roytmana](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roytmana/32/44855_2.png) [@roytmana](https://discuss.elastic.co/u/roytmana)\
**Post date:** [February 4, 2013, 9:52pm UTC](https://discuss.elastic.co/t/how-to-get-missing-and-other-stats-when-using-terms-stats-facet/10609/2 "2013-02-04T21:52:28Z")

</div>

Guys, could anyone please comment if it is possible. I need it rather badly  
I sort of expected to have these numbers based on prior experience with  
Terms facet. Without them statistics is incomplete and entirely open-ended  
and unpredictable....

On Sunday, February 3, 2013 2:34:14 PM UTC-5, AlexR wrote:

> Hello I am developing some charting components using terms statistical  
> faceting and I ran into a problem of not being able to account for  
> "missing" (where term on which faceting is done is missing) or "other"  
> (terms not fitting facet size setting and thus not calculated) values  
> making my charts pretty meaningless since they do not operate on entire  
> body of records
> 
> Is it possible to get "other" and "missing" total when using  
> "terms-stats" similar to how "other" and "missing" count is provided when  
> using "terms" facet?

--  
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:** ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)\
**Post date:** [February 5, 2013, 1:29pm UTC](https://discuss.elastic.co/t/how-to-get-missing-and-other-stats-when-using-terms-stats-facet/10609/3 "2013-02-05T13:29:37Z")

</div>

Hi Alex,

For the "other" part: if you don't use filters or facet filters, you should  
be able to see how many hits didn't get into the facet by summing up the  
"count" values from your facet, and comparing it to the total number of  
hits from your query.

## Best regards, Radu

[http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene

On Mon, Feb 4, 2013 at 11:52 PM, AlexR [roytmana@gmail.com](mailto:roytmana@gmail.com) wrote:

> Guys, could anyone please comment if it is possible. I need it rather  
> badly I sort of expected to have these numbers based on prior experience  
> with Terms facet. Without them statistics is incomplete and entirely  
> open-ended and unpredictable....
> 
> On Sunday, February 3, 2013 2:34:14 PM UTC-5, AlexR wrote:
> 
> > Hello I am developing some charting components using terms statistical  
> > faceting and I ran into a problem of not being able to account for  
> > "missing" (where term on which faceting is done is missing) or "other"  
> > (terms not fitting facet size setting and thus not calculated) values  
> > making my charts pretty meaningless since they do not operate on entire  
> > body of records
> > 
> > Is it possible to get "other" and "missing" total when using  
> > "terms-stats" similar to how "other" and "missing" count is provided when  
> > using "terms" facet?
> 
> --  
> 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:** ![roytmana](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roytmana/32/44855_2.png) [@roytmana](https://discuss.elastic.co/u/roytmana)\
**Post date:** [February 5, 2013, 3:20pm UTC](https://discuss.elastic.co/t/how-to-get-missing-and-other-stats-when-using-terms-stats-facet/10609/4 "2013-02-05T15:20:37Z")

</div>

Thank you Radu,

Unfortunately I use filters very heavily. I am developing a generic UI for  
navigating/selecting facets and filtering/doing stats based on them  
Also what I need very much is not just counts but totals for missing and  
other.

I wonder why it is not included? Performance?  
I guess I could take the ugly approach of doing terms, and statistics facet  
for every terms\_stats facet to get these values but I would really like to  
avoid it

Alex

On Tuesday, February 5, 2013 8:29:37 AM UTC-5, Radu Gheorghe wrote:

> Hi Alex,
> 
> For the "other" part: if you don't use filters or facet filters, you  
> should be able to see how many hits didn't get into the facet by summing up  
> the "count" values from your facet, and comparing it to the total number of  
> hits from your query.
> 
> ## Best regards, Radu
> 
> [http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene
> 
> On Mon, Feb 4, 2013 at 11:52 PM, AlexR \<[royt...@gmail.com](mailto:royt...@gmail.com) \<javascript:\>\>wrote:
> 
> > Guys, could anyone please comment if it is possible. I need it rather  
> > badly I sort of expected to have these numbers based on prior experience  
> > with Terms facet. Without them statistics is incomplete and entirely  
> > open-ended and unpredictable....
> > 
> > On Sunday, February 3, 2013 2:34:14 PM UTC-5, AlexR wrote:
> > 
> > > Hello I am developing some charting components using terms statistical  
> > > faceting and I ran into a problem of not being able to account for  
> > > "missing" (where term on which faceting is done is missing) or "other"  
> > > (terms not fitting facet size setting and thus not calculated) values  
> > > making my charts pretty meaningless since they do not operate on entire  
> > > body of records
> > > 
> > > Is it possible to get "other" and "missing" total when using  
> > > "terms-stats" similar to how "other" and "missing" count is provided when  
> > > using "terms" facet?
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > 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:52am UTC](https://discuss.elastic.co/t/how-to-get-missing-and-other-stats-when-using-terms-stats-facet/10609/5 "2017-07-06T02:52:56Z")

</div>


