# Search results do not match facet count where it should

**URL:** <https://discuss.elastic.co/t/search-results-do-not-match-facet-count-where-it-should/15199>\
**Category:** Elasticsearch\
**Created:** [January 10, 2014, 3:21pm UTC](https://discuss.elastic.co/t/search-results-do-not-match-facet-count-where-it-should/15199 "2014-01-10T15:21:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sofrit0](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sofrit0/32/1876_2.png) [@Sofrit0](https://discuss.elastic.co/u/Sofrit0)\
**Post date:** [January 10, 2014, 3:21pm UTC](https://discuss.elastic.co/t/search-results-do-not-match-facet-count-where-it-should/15199/1 "2014-01-10T15:21:47Z")

</div>

I'm doing phrase\_prefix search for 'engineer' and I get 36 count for term  
'Engineering' in 'skills' field facet. Next I apply a term filter on that  
field for 'Engineering' and in the new filtered results now the count for  
'Engineering' in the facet is 42.

The filtered query returns 42 results, and each document does match the  
facet, that is, they all contain 'Engineering' as a skill.

So I would expect the non-filtered query to have a 42 count for the  
'Engineering' term in 'skills' facet, but as I mentioned above it's just 36.

Here's mapping and query

> <https://gist.github.com/santiago/a249418e5bf7531ead85>

What I'm missing here?

Thanks

I'm using ES 0.90.5

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e1146a5c-768b-4e6b-b499-e36748ddde36%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e1146a5c-768b-4e6b-b499-e36748ddde36%40googlegroups.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:** [January 14, 2014, 11:34am UTC](https://discuss.elastic.co/t/search-results-do-not-match-facet-count-where-it-should/15199/2 "2014-01-14T11:34:36Z")

</div>

Hey,

just to make sure I understood your query correctly:

Your phrase prefix search does not search in the skills field? This means  
the search for engineer goes somewhere else.  
Second, when you add the term filter, do you keep the query or are you  
simply replacing it? Not sure I got that right.

Can you possibly create a gist using your real data and including all the  
curl calls you used, so one can recreate it locally and see what happens?

--Alex

On Fri, Jan 10, 2014 at 4:21 PM, Santiago Gaviria [sgaviria@gmail.com](mailto:sgaviria@gmail.com)wrote:

> I'm doing phrase\_prefix search for 'engineer' and I get 36 count for term  
> 'Engineering' in 'skills' field facet. Next I apply a term filter on that  
> field for 'Engineering' and in the new filtered results now the count for  
> 'Engineering' in the facet is 42.
> 
> The filtered query returns 42 results, and each document does match the  
> facet, that is, they all contain 'Engineering' as a skill.
> 
> So I would expect the non-filtered query to have a 42 count for the  
> 'Engineering' term in 'skills' facet, but as I mentioned above it's just 36.
> 
> Here's mapping and query  
> [query.json · GitHub](https://gist.github.com/santiago/a249418e5bf7531ead85)
> 
> What I'm missing here?
> 
> Thanks
> 
> I'm using ES 0.90.5
> 
> --  
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/e1146a5c-768b-4e6b-b499-e36748ddde36%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e1146a5c-768b-4e6b-b499-e36748ddde36%40googlegroups.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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAGCwEM92ZpbxG2tEtgqGkKGGH%2BtDxcZNQnwXymY2uBYcKMZvmQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGCwEM92ZpbxG2tEtgqGkKGGH%2BtDxcZNQnwXymY2uBYcKMZvmQ%40mail.gmail.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, 1:56am UTC](https://discuss.elastic.co/t/search-results-do-not-match-facet-count-where-it-should/15199/3 "2017-07-06T01:56:56Z")

</div>

Closed on July 6, 2017, 1:56am UTC


