# Facet\_filter for boolean field does not work in TermsFacetBuilder

**URL:** <https://discuss.elastic.co/t/facet-filter-for-boolean-field-does-not-work-in-termsfacetbuilder/15030>\
**Category:** Elasticsearch\
**Created:** [December 27, 2013, 9:20am UTC](https://discuss.elastic.co/t/facet-filter-for-boolean-field-does-not-work-in-termsfacetbuilder/15030 "2013-12-27T09:20:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chetana](https://avatars.discourse-cdn.com/v4/letter/c/dbc845/32.png) [@Chetana](https://discuss.elastic.co/u/Chetana)\
**Post date:** [December 27, 2013, 9:20am UTC](https://discuss.elastic.co/t/facet-filter-for-boolean-field-does-not-work-in-termsfacetbuilder/15030/1 "2013-12-27T09:20:27Z")

</div>

I have a boolean field 'flag' which I want to filter for facet field  
'sub\_type'. But the total count is zero though there are some documents  
satisfying the criteria.  
But if I apply facet-filter on any other field (non-boolean) I get the  
results. Is there any work around for this?

Json of Facet looks like :

"facets" : {  
"sub-type" : {  
"terms" : {  
"field" : "sub-type",  
"size" : 10  
},  
"facet\_filter" : {  
"term" : {  
"flag" : true  
}  
},  
"global" : true  
}  
}

Thanks

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/38fc93df-d984-4d2c-a754-2c785088d86c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/38fc93df-d984-4d2c-a754-2c785088d86c%40googlegroups.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:** [December 27, 2013, 3:48pm UTC](https://discuss.elastic.co/t/facet-filter-for-boolean-field-does-not-work-in-termsfacetbuilder/15030/2 "2013-12-27T15:48:28Z")

</div>

Is the sub-type field analyzed?

--

Ivan  
On Dec 27, 2013 1:20 AM, "Chetana" [ambha.career@gmail.com](mailto:ambha.career@gmail.com) wrote:

> I have a boolean field 'flag' which I want to filter for facet field  
> 'sub\_type'. But the total count is zero though there are some documents  
> satisfying the criteria.  
> But if I apply facet-filter on any other field (non-boolean) I get the  
> results. Is there any work around for this?
> 
> Json of Facet looks like :
> 
> "facets" : {  
> "sub-type" : {  
> "terms" : {  
> "field" : "sub-type",  
> "size" : 10  
> },  
> "facet\_filter" : {  
> "term" : {  
> "flag" : true  
> }  
> },  
> "global" : true  
> }  
> }
> 
> Thanks
> 
> --  
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/38fc93df-d984-4d2c-a754-2c785088d86c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/38fc93df-d984-4d2c-a754-2c785088d86c%40googlegroups.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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQAcqQ%3DDBOc\_JcXXJ52kktX23%2BocoUcp1xX4hcP-QB62Pw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQAcqQ%3DDBOc_JcXXJ52kktX23%2BocoUcp1xX4hcP-QB62Pw%40mail.gmail.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, 1:59am UTC](https://discuss.elastic.co/t/facet-filter-for-boolean-field-does-not-work-in-termsfacetbuilder/15030/3 "2017-07-06T01:59:15Z")

</div>


