# Now in master - Facets

**URL:** <https://discuss.elastic.co/t/now-in-master-facets/3011>\
**Category:** Elasticsearch\
**Created:** [June 10, 2010, 7:55pm UTC](https://discuss.elastic.co/t/now-in-master-facets/3011 "2010-06-10T19:55:27Z")\
**Posts on this page:** 6\
**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:** [June 10, 2010, 7:55pm UTC](https://discuss.elastic.co/t/now-in-master-facets/3011/1 "2010-06-10T19:55:27Z")

</div>

Hi,

Now in master, and will be part of 0.9 is much more enhanced facets  
support. On top of the query facet that came with elasticsearch previous  
versions, there are now:

- terms facet: The most frequent terms and their counts.  
[http://github.com/elasticsearch/elasticsearch/issues/207](http://github.com/elasticsearch/elasticsearch/issues/207)
- statistical facet: Numeric field - get statistical information on it,  
including min, max, count, total, mean, std.  
[http://github.com/elasticsearch/elasticsearch/issues/212](http://github.com/elasticsearch/elasticsearch/issues/212)
- histogram facet: my favorite - based on a certain field, break its values  
into buckets and provide aggregations within those facets (aggregations can  
be on the same field or on another field).  
[http://github.com/elasticsearch/elasticsearch/issues/215](http://github.com/elasticsearch/elasticsearch/issues/215),  
[http://github.com/elasticsearch/elasticsearch/issues/219](http://github.com/elasticsearch/elasticsearch/issues/219).

On top of that, all facets can now accept filters that filter even more the  
"result set" they operate on. Also, there are new `and`, `or`, and `not`  
filters that are faster than the `bool` filter, see more here:

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

The global flag is applicable as well to all facets, controlling if they  
will be bounded by the executing query, or run globally (and bounded by the  
filters).

When you have time, take it for a spin and tell me what you think. Other  
facets should be simple to implement (they must be "map reduce-able"), so if  
you have an idea for one, just shout.

-shay.banon

---

<div class="post-metadata">

**Author:** ![egaumer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/egaumer/32/2365_2.png) [@egaumer](https://discuss.elastic.co/u/egaumer)\
**Post date:** [June 10, 2010, 10:17pm UTC](https://discuss.elastic.co/t/now-in-master-facets/3011/2 "2010-06-10T22:17:36Z")

</div>

Just built and tested this. Freaking awesome (the stats facet couldn't have  
come at a better time for me).

Your pace of development has been amazing. I'm starting to think you're a  
machine 😉

-Eric

On Thu, Jun 10, 2010 at 12:55 PM, Shay Banon  
[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> Hi,
> 
> Now in master, and will be part of 0.9 is much more enhanced facets  
> support. On top of the query facet that came with elasticsearch previous  
> versions, there are now:
> 
> - terms facet: The most frequent terms and their counts.  
> [Search Facets: Terms Facets · Issue #207 · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues/207)
> - statistical facet: Numeric field - get statistical information on it,  
> including min, max, count, total, mean, std.  
> [Search Facets: Numeric Statistical Facets · Issue #212 · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues/212)
> - histogram facet: my favorite - based on a certain field, break its values  
> into buckets and provide aggregations within those facets (aggregations can  
> be on the same field or on another field).  
> [Search Facets: Histogram Facets · Issue #215 · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues/215),  
> [Search Facets: Histogram Facet - allow to create buckets with one field name, and aggregate valued on another field · Issue #219 · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues/219).
> 
> On top of that, all facets can now accept filters that filter even more the  
> "result set" they operate on. Also, there are new `and`, `or`, and `not`  
> filters that are faster than the `bool` filter, see more here:  
> [Query DSL: Add `and`, `or`, and `not` filters · Issue #216 · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues/216)
> 
> The global flag is applicable as well to all facets, controlling if they  
> will be bounded by the executing query, or run globally (and bounded by the  
> filters).
> 
> When you have time, take it for a spin and tell me what you think. Other  
> facets should be simple to implement (they must be "map reduce-able"), so if  
> you have an idea for one, just shout.
> 
> -shay.banon

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [June 11, 2010, 9:02am UTC](https://discuss.elastic.co/t/now-in-master-facets/3011/3 "2010-06-11T09:02:08Z")

</div>

Heya

> On top of that, all facets can now accept filters that filter even  
> more the "result set" they operate on. Also, there are new `and`,  
> `or`, and `not` filters that are faster than the `bool` filter, see  
> more here: [Query DSL: Add `and`, `or`, and `not` filters · Issue #216 · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues/216)

Very nice - out of interest, why do Lucene use should|must|mustNot  
rather than the more obvious (to me, at least) and|or|not, especially if  
(as you say) the latter performs better?

clint

---

<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:** [June 11, 2010, 7:55pm UTC](https://discuss.elastic.co/t/now-in-master-facets/3011/4 "2010-06-11T19:55:19Z")

</div>

Its just an extension to filters that provide that called bool filter, and I  
guess the idea was to create something similar to the boolean query. The  
other ones (and/or/not) are not part of Lucene or its modules.

-shay.banon

On Fri, Jun 11, 2010 at 12:02 PM, Clinton Gormley  
[clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk)wrote:

> Heya
> 
> > On top of that, all facets can now accept filters that filter even  
> > more the "result set" they operate on. Also, there are new `and`,  
> > `or`, and `not` filters that are faster than the `bool` filter, see  
> > more here: [Query DSL: Add `and`, `or`, and `not` filters · Issue #216 · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues/216)
> 
> Very nice - out of interest, why do Lucene use should|must|mustNot  
> rather than the more obvious (to me, at least) and|or|not, especially if  
> (as you say) the latter performs better?
> 
> clint

---

<div class="post-metadata">

**Author:** ![Samuel\_Doyle](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@Samuel\_Doyle](https://discuss.elastic.co/u/Samuel_Doyle)\
**Post date:** [June 25, 2010, 10:53am UTC](https://discuss.elastic.co/t/now-in-master-facets/3011/5 "2010-06-25T10:53:17Z")

</div>

Very nice, I had a request for something like this glad to see it was added.  
🙂

On Fri, Jun 11, 2010 at 12:55 PM, Shay Banon  
[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> Its just an extension to filters that provide that called bool filter, and  
> I guess the idea was to create something similar to the boolean query. The  
> other ones (and/or/not) are not part of Lucene or its modules.
> 
> -shay.banon
> 
> On Fri, Jun 11, 2010 at 12:02 PM, Clinton Gormley \<[clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk)
> 
> > wrote:
> 
> > Heya
> > 
> > > On top of that, all facets can now accept filters that filter even  
> > > more the "result set" they operate on. Also, there are new `and`,  
> > > `or`, and `not` filters that are faster than the `bool` filter, see  
> > > more here: [Query DSL: Add `and`, `or`, and `not` filters · Issue #216 · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues/216)
> > 
> > Very nice - out of interest, why do Lucene use should|must|mustNot  
> > rather than the more obvious (to me, at least) and|or|not, especially if  
> > (as you say) the latter performs better?
> > 
> > clint

---

<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:23am UTC](https://discuss.elastic.co/t/now-in-master-facets/3011/6 "2017-07-06T04:23:00Z")

</div>


