# Facet script + facet\_filter

**URL:** <https://discuss.elastic.co/t/facet-script-facet-filter/12478>\
**Category:** Elasticsearch\
**Created:** [June 19, 2013, 10:56am UTC](https://discuss.elastic.co/t/facet-script-facet-filter/12478 "2013-06-19T10:56:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samuel\_Molnar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samuel_molnar/32/2253_2.png) [@Samuel\_Molnar](https://discuss.elastic.co/u/Samuel_Molnar)\
**Post date:** [June 19, 2013, 10:56am UTC](https://discuss.elastic.co/t/facet-script-facet-filter/12478/1 "2013-06-19T10:56:29Z")

</div>

Hi,

is it possible to use facet script and facet\_filter at once? Example:

{  
"facets": {  
"judges": {  
"terms": {  
"field": "judges.untouched",  
"size": 10,  
"all\_terms": false,  
"script": { "script": "...", "params": { }}  
},  
"global\_facets": false,  
"facet\_filter": {  
"and": [  
{  
"query": {  
"query\_string": {  
"query": "..... ",  
"fields": [  
"judges.analyzed"  
],  
"default\_operator": "and",  
"analyze\_wildcard": true  
}  
}  
}  
]  
}  
}  
}  
}

Because when i run this query, elasticsearch raises error: Parse Failure  
[No facet type found for [and]]]; }

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:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [June 24, 2013, 1:48pm UTC](https://discuss.elastic.co/t/facet-script-facet-filter/12478/2 "2013-06-24T13:48:18Z")

</div>

Hey,

a facet filter is part of the particular facet (like the terms facet in  
your example). See the facet filter section

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

--Alex

On Wed, Jun 19, 2013 at 12:56 PM, Samuel Molnar [molnar.samuel@gmail.com](mailto:molnar.samuel@gmail.com)wrote:

> Hi,
> 
> is it possible to use facet script and facet\_filter at once? Example:
> 
> {  
> "facets": {  
> "judges": {  
> "terms": {  
> "field": "judges.untouched",  
> "size": 10,  
> "all\_terms": false,  
> "script": { "script": "...", "params": { }}  
> },  
> "global\_facets": false,  
> "facet\_filter": {  
> "and": [  
> {  
> "query": {  
> "query\_string": {  
> "query": "..... ",  
> "fields": [  
> "judges.analyzed"  
> ],  
> "default\_operator": "and",  
> "analyze\_wildcard": true  
> }  
> }  
> }  
> ]  
> }  
> }  
> }  
> }
> 
> Because when i run this query, elasticsearch raises error: Parse Failure  
> [No facet type found for [and]]]; }
> 
> 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:29am UTC](https://discuss.elastic.co/t/facet-script-facet-filter/12478/3 "2017-07-06T02:29:48Z")

</div>


