# Facets & string query vs. match\_all

**URL:** <https://discuss.elastic.co/t/facets-string-query-vs-match-all/12188>\
**Category:** Elasticsearch\
**Created:** [May 30, 2013, 8:48am UTC](https://discuss.elastic.co/t/facets-string-query-vs-match-all/12188 "2013-05-30T08:48:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yann\_Barraud](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yann_barraud/32/1108_2.png) [@Yann\_Barraud](https://discuss.elastic.co/u/Yann_Barraud)\
**Post date:** [May 30, 2013, 8:48am UTC](https://discuss.elastic.co/t/facets-string-query-vs-match-all/12188/1 "2013-05-30T08:48:02Z")

</div>

Hi,

I recently played with facets and queries. What I saw is when building a  
facet in a query matching amounts of docs, the facet count is erroneous.  
This is visible when you click the facet.

For exemple, I look for people named Mike, and create a facet on zip\_code  
field. The facet will show up 1234 people matching on zip\_code 75017. When  
I add zip\_code="75017", I get 1578 people matching.

Is there a way to have the right count at first query ?

Thanks.

Regards,  
Yann

--  
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:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 30, 2013, 8:55am UTC](https://discuss.elastic.co/t/facets-string-query-vs-match-all/12188/2 "2013-05-30T08:55:45Z")

</div>

Two options:  
Ask for more Terms. It will reduce the chance to get a not complete count  
Only send your docs in a single shard and compute only on that shard. You will have accurate results.

Another option is to display to user percentages and not absolute values! 😉

## HTH

David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 30 mai 2013 à 10:48, Yann Barraud [yann.barraud@gmail.com](mailto:yann.barraud@gmail.com) a écrit :

> Hi,
> 
> I recently played with facets and queries. What I saw is when building a facet in a query matching amounts of docs, the facet count is erroneous. This is visible when you click the facet.
> 
> For exemple, I look for people named Mike, and create a facet on zip\_code field. The facet will show up 1234 people matching on zip\_code 75017. When I add zip\_code="75017", I get 1578 people matching.
> 
> Is there a way to have the right count at first query ?
> 
> Thanks.
> 
> Regards,  
> Yann
> 
> --  
> 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:33am UTC](https://discuss.elastic.co/t/facets-string-query-vs-match-all/12188/3 "2017-07-06T02:33:55Z")

</div>


