# Excluding facet range if no value

**URL:** <https://discuss.elastic.co/t/excluding-facet-range-if-no-value/7127>\
**Category:** Elasticsearch\
**Created:** [March 26, 2012, 12:19pm UTC](https://discuss.elastic.co/t/excluding-facet-range-if-no-value/7127 "2012-03-26T12:19:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![my3sons](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@my3sons](https://discuss.elastic.co/u/my3sons)\
**Post date:** [March 26, 2012, 12:19pm UTC](https://discuss.elastic.co/t/excluding-facet-range-if-no-value/7127/1 "2012-03-26T12:19:52Z")

</div>

Is there something similar to the terms facet directive "all\_terms" : true for range facets? I would like to NOT return any ranges that do not have a hit associated to them.

---

<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:** [March 27, 2012, 1:13pm UTC](https://discuss.elastic.co/t/excluding-facet-range-if-no-value/7127/2 "2012-03-27T13:13:44Z")

</div>

Can't you ignore the ones with 0 count?

On Mon, Mar 26, 2012 at 2:19 PM, my3sons [carey.boldenow@gmail.com](mailto:carey.boldenow@gmail.com) wrote:

> Is there something similar to the terms facet directive "all\_terms" : true  
> for range facets? I would like to NOT return any ranges that do not have a  
> hit associated to them.
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/excluding-facet-range-if-no-value-tp3857993p3857993.html](http://elasticsearch-users.115913.n3.nabble.com/excluding-facet-range-if-no-value-tp3857993p3857993.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![my3sons](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@my3sons](https://discuss.elastic.co/u/my3sons)\
**Post date:** [March 27, 2012, 2:24pm UTC](https://discuss.elastic.co/t/excluding-facet-range-if-no-value/7127/3 "2012-03-27T14:24:06Z")

</div>

Certainly we can do that, I was just hoping to not have any code at the  
front-end to deal with that.

On Tuesday, March 27, 2012 8:13:44 AM UTC-5, kimchy wrote:

> Can't you ignore the ones with 0 count?
> 
> On Mon, Mar 26, 2012 at 2:19 PM, my3sons wrote:
> 
> > Is there something similar to the terms facet directive "all\_terms" : true  
> > for range facets? I would like to NOT return any ranges that do not have a  
> > hit associated to them.
> > 
> > --  
> > View this message in context:  
> > [http://elasticsearch-users.115913.n3.nabble.com/excluding-facet-range-if-no-value-tp3857993p3857993.html](http://elasticsearch-users.115913.n3.nabble.com/excluding-facet-range-if-no-value-tp3857993p3857993.html)  
> > Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<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:** [March 28, 2012, 10:24am UTC](https://discuss.elastic.co/t/excluding-facet-range-if-no-value/7127/4 "2012-03-28T10:24:51Z")

</div>

I see, there is no option to exclude 0 count ranges from the range  
facet..., so you need to exclude it yourself....

On Tue, Mar 27, 2012 at 4:24 PM, my3sons [carey.boldenow@gmail.com](mailto:carey.boldenow@gmail.com) wrote:

> Certainly we can do that, I was just hoping to not have any code at the  
> front-end to deal with that.
> 
> On Tuesday, March 27, 2012 8:13:44 AM UTC-5, kimchy wrote:
> 
> > Can't you ignore the ones with 0 count?
> > 
> > On Mon, Mar 26, 2012 at 2:19 PM, my3sons wrote:
> > 
> > > Is there something similar to the terms facet directive "all\_terms" :  
> > > true  
> > > for range facets? I would like to NOT return any ranges that do not have  
> > > a  
> > > hit associated to them.
> > > 
> > > --  
> > > View this message in context: [http://elasticsearch-users](http://elasticsearch-users).\*\*  
> > > [115913.n3.nabble.com/](http://115913.n3.nabble.com/) **excluding-facet-range-if-no-**  
> > > value-tp3857993p3857993.html[http://elasticsearch-users.115913.n3.nabble.com/excluding-facet-range-if-no-value-tp3857993p3857993.html](http://elasticsearch-users.115913.n3.nabble.com/excluding-facet-range-if-no-value-tp3857993p3857993.html)  
> > > Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<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:34am UTC](https://discuss.elastic.co/t/excluding-facet-range-if-no-value/7127/5 "2017-07-06T03:34:24Z")

</div>


