# Setting up ES facets like Endeca

**URL:** https://discuss.elastic.co/t/setting-up-es-facets-like-endeca/13289
**Category:** Elasticsearch
**Created:** [August 21, 2013, 11:13pm UTC](https://discuss.elastic.co/t/setting-up-es-facets-like-endeca/13289 "2013-08-21T23:13:53Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Travis\_Chase](https://avatars.discourse-cdn.com/v4/letter/t/7ab992/32.png) [@Travis\_Chase](https://discuss.elastic.co/u/Travis_Chase)
#### Post date: [August 21, 2013, 11:13pm UTC](https://discuss.elastic.co/t/setting-up-es-facets-like-endeca/13289/1 "2013-08-21T23:13:53Z")

</div>

Is it possible to setup ES facets like Endeca's? I want to be able setup by  
facet if it is a multi-select or and an and. In the case of Endeca you can  
setup a facet, dimension, so that it is multi-select and that the counts  
for the facet take in account just query term not the filters. I know that  
the filter element allows you to setup facet navigation ignoring what  
filters are set and filtered queries allow you to have facet counts based  
off the filter applied. I want to mix and match these.

For example:

Language:

- English (12)
- French (10)
- Spain (5)

I apply the English filter and get a result of 12 records and the facet  
would look like

Language:

- French (10)
- Spain (5)

I then apply French as well and get 22 records cause it is a or filter

With other facets on the page I want the counts to be limited by the  
filters applied say a facet Gender. Is this possible in ElasticSearch?

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).  
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: [August 21, 2013, 11:41pm UTC](https://discuss.elastic.co/t/setting-up-es-facets-like-endeca/13289/2 "2013-08-21T23:41:20Z")

</div>

Each facet can take a different filter (facet\_filter) than the one the  
query uses. You can facet on the Language field while adding the current  
select languages as an exclude term. With the Gender facet, you can just  
apply the same filter from the query.

Something like:  
{  
"query" : { "match\_all" : { } },  
"filter" : { "term" : { "Language" : "English" } }  
"facets" : {  
"Language" : {  
"terms" : {  
"field" : "Language",  
"exclude" : ["English"]  
}  
},  
"Language" : {  
"terms" : {  
"field" : "Gender"  
}  
"facet\_filter" : {  
"term" : { "Language" : "English" }  
}  
}  
}  
}

Cheers,

Ivan

On Wed, Aug 21, 2013 at 4:13 PM, Travis Chase [tchase@kyru.us](mailto:tchase@kyru.us) wrote:

> Is it possible to setup ES facets like Endeca's? I want to be able setup  
> by facet if it is a multi-select or and an and. In the case of Endeca you  
> can setup a facet, dimension, so that it is multi-select and that the  
> counts for the facet take in account just query term not the filters. I  
> know that the filter element allows you to setup facet navigation ignoring  
> what filters are set and filtered queries allow you to have facet counts  
> based off the filter applied. I want to mix and match these.
> 
> For example:
> 
> Language:
> 
> - English (12)
> - French (10)
> - Spain (5)
> 
> I apply the English filter and get a result of 12 records and the facet  
> would look like
> 
> Language:
> 
> - French (10)
> - Spain (5)
> 
> I then apply French as well and get 22 records cause it is a or filter
> 
> With other facets on the page I want the counts to be limited by the  
> filters applied say a facet Gender. Is this possible in Elasticsearch?
> 
> 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).  
> 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).  
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, 2:20am UTC](https://discuss.elastic.co/t/setting-up-es-facets-like-endeca/13289/3 "2017-07-06T02:20:17Z")

</div>


