# Stats on Missing Facet

**URL:** <https://discuss.elastic.co/t/stats-on-missing-facet/5945>\
**Category:** Elasticsearch\
**Created:** [November 22, 2011, 5:15pm UTC](https://discuss.elastic.co/t/stats-on-missing-facet/5945 "2011-11-22T17:15:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Sick](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@Michael\_Sick](https://discuss.elastic.co/u/Michael_Sick)\
**Post date:** [November 22, 2011, 5:15pm UTC](https://discuss.elastic.co/t/stats-on-missing-facet/5945/1 "2011-11-22T17:15:33Z")

</div>

For a faceted query, I'm returning data as a table showing the key\_field,  
counts, and min/max of the value\_field. It's required to show the min/max  
of the value field even for the group that has the facet key\_field null. In  
this case, facet.getMissingCount() isn't enough. Is there currently a way  
to get the min/max (or other stats) for the missing case loaded as a facet?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [November 23, 2011, 3:42pm UTC](https://discuss.elastic.co/t/stats-on-missing-facet/5945/2 "2011-11-23T15:42:55Z")

</div>

You can open an issue to support it, for now, you can simply index a value  
that represents null.

On Tue, Nov 22, 2011 at 7:15 PM, Michael Sick \<  
[michael.sick@serenesoftware.com](mailto:michael.sick@serenesoftware.com)\> wrote:

> For a faceted query, I'm returning data as a table showing the key\_field,  
> counts, and min/max of the value\_field. It's required to show the min/max  
> of the value field even for the group that has the facet key\_field null. In  
> this case, facet.getMissingCount() isn't enough. Is there currently a way  
> to get the min/max (or other stats) for the missing case loaded as a facet?

---

<div class="post-metadata">

**Author:** ![Michael\_Sick](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@Michael\_Sick](https://discuss.elastic.co/u/Michael_Sick)\
**Post date:** [November 23, 2011, 4:23pm UTC](https://discuss.elastic.co/t/stats-on-missing-facet/5945/3 "2011-11-23T16:23:23Z")

</div>

Opened at: [Request: Facet for Missing Term on TermStatsFacet · Issue #1491 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/1491)

On Wed, Nov 23, 2011 at 10:42 AM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> You can open an issue to support it, for now, you can simply index a value  
> that represents null.
> 
> On Tue, Nov 22, 2011 at 7:15 PM, Michael Sick \<  
> [michael.sick@serenesoftware.com](mailto:michael.sick@serenesoftware.com)\> wrote:
> 
> > For a faceted query, I'm returning data as a table showing the key\_field,  
> > counts, and min/max of the value\_field. It's required to show the min/max  
> > of the value field even for the group that has the facet key\_field null. In  
> > this case, facet.getMissingCount() isn't enough. Is there currently a way  
> > to get the min/max (or other stats) for the missing case loaded as a facet?

---

<div class="post-metadata">

**Author:** ![Michael\_Sick](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@Michael\_Sick](https://discuss.elastic.co/u/Michael_Sick)\
**Post date:** [November 25, 2011, 4:11pm UTC](https://discuss.elastic.co/t/stats-on-missing-facet/5945/4 "2011-11-25T16:11:08Z")

</div>

I tried reindexing using the null\_value option:

aud\_tran\_typ\_id: {  
include\_in\_all: true  
index: not\_analyzed  
store: yes  
null\_value: eas.missing  
type: string  
}

but the value does not end up in my facet counts. Should it or should I  
have to add the default value in my code?

On Wed, Nov 23, 2011 at 11:23 AM, Michael Sick \<  
[michael.sick@serenesoftware.com](mailto:michael.sick@serenesoftware.com)\> wrote:

> Opened at: [Request: Facet for Missing Term on TermStatsFacet · Issue #1491 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/1491)
> 
> On Wed, Nov 23, 2011 at 10:42 AM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> 
> > You can open an issue to support it, for now, you can simply index a  
> > value that represents null.
> > 
> > On Tue, Nov 22, 2011 at 7:15 PM, Michael Sick \<  
> > [michael.sick@serenesoftware.com](mailto:michael.sick@serenesoftware.com)\> wrote:
> > 
> > > For a faceted query, I'm returning data as a table showing the  
> > > key\_field, counts, and min/max of the value\_field. It's required to show  
> > > the min/max of the value field even for the group that has the facet  
> > > key\_field null. In this case, facet.getMissingCount() isn't enough. Is  
> > > there currently a way to get the min/max (or other stats) for the missing  
> > > case loaded as a facet?

---

<div class="post-metadata">

**Author:** ![Michael\_Sick](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@Michael\_Sick](https://discuss.elastic.co/u/Michael_Sick)\
**Post date:** [November 25, 2011, 5:16pm UTC](https://discuss.elastic.co/t/stats-on-missing-facet/5945/5 "2011-11-25T17:16:29Z")

</div>

Apologies, works fine. All trouble the result of overly fat fingers.

On Fri, Nov 25, 2011 at 11:11 AM, Michael Sick \<  
[michael.sick@serenesoftware.com](mailto:michael.sick@serenesoftware.com)\> wrote:

> I tried reindexing using the null\_value option:
> 
> aud\_tran\_typ\_id: {  
> include\_in\_all: true  
> index: not\_analyzed  
> store: yes  
> null\_value: eas.missing  
> type: string  
> }
> 
> but the value does not end up in my facet counts. Should it or should I  
> have to add the default value in my code?
> 
> On Wed, Nov 23, 2011 at 11:23 AM, Michael Sick \<  
> [michael.sick@serenesoftware.com](mailto:michael.sick@serenesoftware.com)\> wrote:
> 
> > Opened at: [Request: Facet for Missing Term on TermStatsFacet · Issue #1491 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/1491)
> > 
> > On Wed, Nov 23, 2011 at 10:42 AM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> > 
> > > You can open an issue to support it, for now, you can simply index a  
> > > value that represents null.
> > > 
> > > On Tue, Nov 22, 2011 at 7:15 PM, Michael Sick \<  
> > > [michael.sick@serenesoftware.com](mailto:michael.sick@serenesoftware.com)\> wrote:
> > > 
> > > > For a faceted query, I'm returning data as a table showing the  
> > > > key\_field, counts, and min/max of the value\_field. It's required to show  
> > > > the min/max of the value field even for the group that has the facet  
> > > > key\_field null. In this case, facet.getMissingCount() isn't enough. Is  
> > > > there currently a way to get the min/max (or other stats) for the missing  
> > > > case loaded as a facet?

---

<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, 3:47am UTC](https://discuss.elastic.co/t/stats-on-missing-facet/5945/6 "2017-07-06T03:47:27Z")

</div>


