# Just Pushed: Enhancements to Term Facets

**URL:** <https://discuss.elastic.co/t/just-pushed-enhancements-to-term-facets/3418>\
**Category:** Elasticsearch\
**Created:** [October 6, 2010, 11:54pm UTC](https://discuss.elastic.co/t/just-pushed-enhancements-to-term-facets/3418 "2010-10-06T23:54:31Z")\
**Posts on this page:** 2\
**Page:** 1

<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:** [October 6, 2010, 11:54pm UTC](https://discuss.elastic.co/t/just-pushed-enhancements-to-term-facets/3418/1 "2010-10-06T23:54:31Z")

</div>

Hey,

Just pushed support to provide several fields for term facet to run on:  
[http://github.com/elasticsearch/elasticsearch/issues/issue/405](http://github.com/elasticsearch/elasticsearch/issues/issue/405). Later, when  
working on another enhancement for terms facet (explained below), it struck  
me that if you execute a search request with several term facets (on  
different fields) but use the same facet name for them, they will get  
aggregated automatically :). So basically, the above feature can now be used  
by simply execute two term facets, with the same facet name, on two  
different fields.

This feature :), which is a side effect of the map reduce nature of how  
facets works, can be used on _any_ facet of the same type (for example, have  
histogram facet executed on different fields and use the same facet name).

The next enhancement to term facet is the ability to just use a script in  
it. When providing a field name, the script is used to filter out terms.  
When providing just script without a field, then the script will be  
responsible for producing terms.

> <https://github.com/elastic/elasticsearch/issues/410>

-shay.banon

---

<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, 4:18am UTC](https://discuss.elastic.co/t/just-pushed-enhancements-to-term-facets/3418/2 "2017-07-06T04:18:17Z")

</div>


