# Force facet item to show up

**URL:** <https://discuss.elastic.co/t/force-facet-item-to-show-up/12721>\
**Category:** Elasticsearch\
**Created:** [July 9, 2013, 3:09pm UTC](https://discuss.elastic.co/t/force-facet-item-to-show-up/12721 "2013-07-09T15:09:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeremie\_bordier](https://avatars.discourse-cdn.com/v4/letter/j/919ad9/32.png) [@jeremie\_bordier](https://discuss.elastic.co/u/jeremie_bordier)\
**Post date:** [July 9, 2013, 3:09pm UTC](https://discuss.elastic.co/t/force-facet-item-to-show-up/12721/1 "2013-07-09T15:09:25Z")

</div>

Hi peeps,

Is there a way to force a facet item to pop up in the facet terms returned  
by elasticsearch even if it's below the X top results ? eg:

I have a facet called "geek terms" that has 50 terms.

I do a filter on the term 'foo', but 'foo' is only the 25th most popular  
term, so it's not sent in my "geek terms" facet that has only 20 items.  
Nevertheless, I would like to show the 'foo' term statistics to my user.

Is there a way to force the facet to return given terms ?

Thanks !

Jérémie

--  
Jérémie 'ahFeel' BORDIER

--  
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:** [July 9, 2013, 9:25pm UTC](https://discuss.elastic.co/t/force-facet-item-to-show-up/12721/2 "2013-07-09T21:25:30Z")

</div>

The only solution I can think of is two facets, where one of them uses a  
regex of 'foo', that are then combined on the client side.

--  
Ivan

On Tue, Jul 9, 2013 at 8:09 AM, Jérémie BORDIER [ahfeel@gmail.com](mailto:ahfeel@gmail.com) wrote:

> Hi peeps,
> 
> Is there a way to force a facet item to pop up in the facet terms returned  
> by elasticsearch even if it's below the X top results ? eg:
> 
> I have a facet called "geek terms" that has 50 terms.
> 
> I do a filter on the term 'foo', but 'foo' is only the 25th most popular  
> term, so it's not sent in my "geek terms" facet that has only 20 items.  
> Nevertheless, I would like to show the 'foo' term statistics to my user.
> 
> Is there a way to force the facet to return given terms ?
> 
> Thanks !
> 
> Jérémie
> 
> --  
> Jérémie 'ahFeel' BORDIER
> 
> --  
> 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:** ![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:** [July 10, 2013, 8:46am UTC](https://discuss.elastic.co/t/force-facet-item-to-show-up/12721/3 "2013-07-10T08:46:08Z")

</div>

Hey,

maybe the regex option of the terms stats filter can help you, see

> **[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 Tue, Jul 9, 2013 at 5:09 PM, Jérémie BORDIER [ahfeel@gmail.com](mailto:ahfeel@gmail.com) wrote:

> Hi peeps,
> 
> Is there a way to force a facet item to pop up in the facet terms returned  
> by elasticsearch even if it's below the X top results ? eg:
> 
> I have a facet called "geek terms" that has 50 terms.
> 
> I do a filter on the term 'foo', but 'foo' is only the 25th most popular  
> term, so it's not sent in my "geek terms" facet that has only 20 items.  
> Nevertheless, I would like to show the 'foo' term statistics to my user.
> 
> Is there a way to force the facet to return given terms ?
> 
> Thanks !
> 
> Jérémie
> 
> --  
> Jérémie 'ahFeel' BORDIER
> 
> --  
> 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:27am UTC](https://discuss.elastic.co/t/force-facet-item-to-show-up/12721/4 "2017-07-06T02:27:16Z")

</div>


