# Linked like facet counts

**URL:** <https://discuss.elastic.co/t/linked-like-facet-counts/7362>\
**Category:** Elasticsearch\
**Created:** [April 17, 2012, 5:12am UTC](https://discuss.elastic.co/t/linked-like-facet-counts/7362 "2012-04-17T05:12:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![smiley](https://avatars.discourse-cdn.com/v4/letter/s/0ea827/32.png) [@smiley](https://discuss.elastic.co/u/smiley)\
**Post date:** [April 17, 2012, 5:12am UTC](https://discuss.elastic.co/t/linked-like-facet-counts/7362/1 "2012-04-17T05:12:27Z")

</div>

Hi all

I am a bit noob in searching and elastic search. I have successfully  
managed to use elastic search in an application using tire(  
[https://github.com/karmi/tire](https://github.com/karmi/tire)) but an enhancement relating to count for  
facets is bothering me very much. I had googled the issue but couldn't find  
relevant clues. The issue is that when I search on a some term (say white  
on color) then the facet count is only returning count for white. I want  
the counts for other colors also provided with the other conditions that  
are there like screen size of laptops etc.. If I use _global:true_ than the  
other terms being searched are not taken into account for the count.  
Kindly refer to attached images from [linkedin.com](http://linkedin.com) and  
[https://gist.github.com/2403416](https://gist.github.com/2403416) for my example.

thanks for any assistance that could be done

regards

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [April 17, 2012, 2:27pm UTC](https://discuss.elastic.co/t/linked-like-facet-counts/7362/2 "2012-04-17T14:27:19Z")

</div>

You can divide your query into query and filter. The query part will  
affect both the returned documents and facet counts, while filters will  
only affect returned documents. In other words, put terms into the query,  
and use filters for colors, screen sizes, etc.

On Tuesday, April 17, 2012 1:12:27 AM UTC-4, smiley wrote:

> Hi all
> 
> I am a bit noob in searching and Elasticsearch. I have successfully  
> managed to use Elasticsearch in an application using tire(  
> [GitHub - karmi/retire: A rich Ruby API and DSL for the Elasticsearch search engine](https://github.com/karmi/tire)) but an enhancement relating to count for  
> facets is bothering me very much. I had googled the issue but couldn't find  
> relevant clues. The issue is that when I search on a some term (say white  
> on color) then the facet count is only returning count for white. I want  
> the counts for other colors also provided with the other conditions that  
> are there like screen size of laptops etc.. If I use _global:true_ than  
> the other terms being searched are not taken into account for the count.  
> Kindly refer to attached images from [linkedin.com](http://linkedin.com) and  
> [Facets are only showing local counts, I want to have counts like "linkedin.com" that are local but not include current term (i.e. color here). · GitHub](https://gist.github.com/2403416) for my example.
> 
> thanks for any assistance that could be done
> 
> regards

---

<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, 3:32am UTC](https://discuss.elastic.co/t/linked-like-facet-counts/7362/3 "2017-07-06T03:32:12Z")

</div>


