# \[Posible bug\] Re: Loss of count accuracy for term facets

**URL:** <https://discuss.elastic.co/t/posible-bug-re-loss-of-count-accuracy-for-term-facets/14564>\
**Category:** Elasticsearch\
**Created:** [November 24, 2013, 10:46am UTC](https://discuss.elastic.co/t/posible-bug-re-loss-of-count-accuracy-for-term-facets/14564 "2013-11-24T10:46:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vineeth\_mohan\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vineeth_mohan_2/32/747_2.png) [@vineeth\_mohan\_2](https://discuss.elastic.co/u/vineeth_mohan_2)\
**Post date:** [November 24, 2013, 10:46am UTC](https://discuss.elastic.co/t/posible-bug-re-loss-of-count-accuracy-for-term-facets/14564/1 "2013-11-24T10:46:58Z")

</div>

Kindly look into this. I feel its a bug.

Thanks  
Vineeth

On Fri, Nov 22, 2013 at 12:48 PM, vineeth mohan  
[vm.vineethmohan@gmail.com](mailto:vm.vineethmohan@gmail.com)wrote:

> Hi ,
> 
> On applying term facets to a field called page with query\_string query as  
> query:\* gives me -
> 
> - {
> - term: 10628
> - count: 64  
> }
> 
> - 
> 
> On applying term facets to a field called page with terms query as page:[  
> 10628 ] gives me -
> 
> - {
> - term: 10629
> - count: 100  
> }
> 
> I tried increasing shard size as follows
> 
> "facets": {  
> "terms": {  
> "terms": {  
> "shard\_size": 100000000,  
> "field": "page"  
> }  
> }  
> }
> 
> Still no change.
> 
> What could be the reason of this discrepancy. Only weird thing i did was  
> to index some of the feeds again with the same ID using bulk index. But  
> then , it should be fine.
> 
> - 
> 
> ES details -
> 
> - number: 0.90.5
> - build\_hash: c8714e8e0620b62638f660f6144831792b9dedee
> - build\_timestamp: 2013-09-17T12:50:20Z
> - build\_snapshot: false
> - lucene\_version: 4.4
> 
> Thanks  
> Vineeth
> 
> -

--  
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:** [November 24, 2013, 1:07pm UTC](https://discuss.elastic.co/t/posible-bug-re-loss-of-count-accuracy-for-term-facets/14564/2 "2013-11-24T13:07:06Z")

</div>

Hey,

I am unsure I understand your problem. From what I read

1. You are executing a query, search for anything, facet on field page and  
get back a count of 64 for term 10628
2. You are executing a query with a term query on field "page" and value  
10628, and it returns results where page field is 10629?

wondering if you are accidentally also searching on the all field with one  
of the queries. Can you provide the full queries to make your use case more  
clear? Can you reproduce this with a smaller dataset, so we maybe get a  
full recreation? That would help a lot.

--Alex

On Sun, Nov 24, 2013 at 11:46 AM, vineeth mohan  
[vm.vineethmohan@gmail.com](mailto:vm.vineethmohan@gmail.com)wrote:

> Kindly look into this. I feel its a bug.
> 
> Thanks  
> Vineeth
> 
> On Fri, Nov 22, 2013 at 12:48 PM, vineeth mohan \<[vm.vineethmohan@gmail.com](mailto:vm.vineethmohan@gmail.com)
> 
> > wrote:
> 
> > Hi ,
> > 
> > On applying term facets to a field called page with query\_string query as  
> > query:\* gives me -
> > 
> > - {
> > - term: 10628
> > - count: 64  
> > }
> > 
> > - 
> > 
> > On applying term facets to a field called page with terms query as page:[  
> > 10628 ] gives me -
> > 
> > - {
> > - term: 10629
> > - count: 100  
> > }
> > 
> > I tried increasing shard size as follows
> > 
> > "facets": {  
> > "terms": {  
> > "terms": {  
> > "shard\_size": 100000000,  
> > "field": "page"  
> > }  
> > }  
> > }
> > 
> > Still no change.
> > 
> > What could be the reason of this discrepancy. Only weird thing i did was  
> > to index some of the feeds again with the same ID using bulk index. But  
> > then , it should be fine.
> > 
> > - 
> > 
> > ES details -
> > 
> > - number: 0.90.5
> > - build\_hash: c8714e8e0620b62638f660f6144831792b9dedee
> > - build\_timestamp: 2013-09-17T12:50:20Z
> > - build\_snapshot: false
> > - lucene\_version: 4.4
> > 
> > Thanks  
> > Vineeth
> > 
> > -
> 
> --  
> 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:** ![Henrik\_Nordvik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/henrik_nordvik/32/1096_2.png) [@Henrik\_Nordvik](https://discuss.elastic.co/u/Henrik_Nordvik)\
**Post date:** [November 25, 2013, 12:03pm UTC](https://discuss.elastic.co/t/posible-bug-re-loss-of-count-accuracy-for-term-facets/14564/3 "2013-11-25T12:03:55Z")

</div>

shard\_size was added in 0.90.6 [1]. Upgrade to 0.90.6 or 0.90.7 and it  
should work 🙂

[1]

> **[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.

On Sunday, November 24, 2013 11:46:58 AM UTC+1, vineeth mohan wrote:

> Kindly look into this. I feel its a bug.
> 
> Thanks  
> Vineeth
> 
> On Fri, Nov 22, 2013 at 12:48 PM, vineeth mohan \<[vm.vine...@gmail.com](mailto:vm.vine...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > Hi ,
> > 
> > On applying term facets to a field called page with query\_string query as  
> > query:\* gives me -
> > 
> > - {
> > - term: 10628
> > - count: 64  
> > }
> > 
> > - 
> > 
> > On applying term facets to a field called page with terms query as page:[  
> > 10628 ] gives me -
> > 
> > - {
> > - term: 10629
> > - count: 100  
> > }
> > 
> > I tried increasing shard size as follows
> > 
> > "facets": {  
> > "terms": {  
> > "terms": {  
> > "shard\_size": 100000000,  
> > "field": "page"  
> > }  
> > }  
> > }
> > 
> > Still no change.
> > 
> > What could be the reason of this discrepancy. Only weird thing i did was  
> > to index some of the feeds again with the same ID using bulk index. But  
> > then , it should be fine.
> > 
> > - 
> > 
> > ES details -
> > 
> > - number: 0.90.5
> > - build\_hash: c8714e8e0620b62638f660f6144831792b9dedee
> > - build\_timestamp: 2013-09-17T12:50:20Z
> > - build\_snapshot: false
> > - lucene\_version: 4.4
> > 
> > Thanks  
> > Vineeth
> > 
> > -

--  
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:05am UTC](https://discuss.elastic.co/t/posible-bug-re-loss-of-count-accuracy-for-term-facets/14564/4 "2017-07-06T02:05:01Z")

</div>


