# Bug in bool queries?

**URL:** <https://discuss.elastic.co/t/bug-in-bool-queries/14797>\
**Category:** Elasticsearch\
**Created:** [December 10, 2013, 6:45pm UTC](https://discuss.elastic.co/t/bug-in-bool-queries/14797 "2013-12-10T18:45:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matheus\_Salvia](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@Matheus\_Salvia](https://discuss.elastic.co/u/Matheus_Salvia)\
**Post date:** [December 10, 2013, 6:45pm UTC](https://discuss.elastic.co/t/bug-in-bool-queries/14797/1 "2013-12-10T18:45:55Z")

</div>

Hello everyone,  
I believe I've found a bug concerning bool queries and bool filters.  
Should't the these queries return the same number of hits?  
[http://pastebin.com/twyMX4cD](http://pastebin.com/twyMX4cD)  
I have the need of making some counts and they must be very fast, so I've  
mixed a filtered query with the \_count endpoint to try and increase my  
performance (It Didn't by the way), but I've started to get the wrong  
results (the two queries return different number of hits).  
Am I missing something? Or this is indeed a bug?

Thanks in advance,  
Matheus Salvia

--  
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/CAOJV22aecp4ySxHxp5\_zjaUWWf6oGaeNZQoVd%3DL85PP-GOUddA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAOJV22aecp4ySxHxp5_zjaUWWf6oGaeNZQoVd%3DL85PP-GOUddA%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:** ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)\
**Post date:** [December 12, 2013, 9:04pm UTC](https://discuss.elastic.co/t/bug-in-bool-queries/14797/2 "2013-12-12T21:04:42Z")

</div>

What version of ES are you running? Recently a few bugs have been fixed  
with the has\_child filter.

On 10 December 2013 19:45, Matheus Salvia [matheus2740@gmail.com](mailto:matheus2740@gmail.com) wrote:

> Hello everyone,  
> I believe I've found a bug concerning bool queries and bool filters.  
> Should't the these queries return the same number of hits?  
> [http://pastebin.com/twyMX4cD](http://pastebin.com/twyMX4cD)  
> I have the need of making some counts and they must be very fast, so I've  
> mixed a filtered query with the \_count endpoint to try and increase my  
> performance (It Didn't by the way), but I've started to get the wrong  
> results (the two queries return different number of hits).  
> Am I missing something? Or this is indeed a bug?
> 
> Thanks in advance,  
> Matheus Salvia
> 
> --  
> 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/CAOJV22aecp4ySxHxp5\_zjaUWWf6oGaeNZQoVd%3DL85PP-GOUddA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAOJV22aecp4ySxHxp5_zjaUWWf6oGaeNZQoVd%3DL85PP-GOUddA%40mail.gmail.com)  
> .  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
Met vriendelijke groet,

Martijn van Groningen

--  
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/CA%2BA76TxWQkCzHkPP%2Bn2EKUfigPwsFfO%3DcSMQ8f5eXsaatwAM%2Bw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CA%2BA76TxWQkCzHkPP%2Bn2EKUfigPwsFfO%3DcSMQ8f5eXsaatwAM%2Bw%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, 2:01am UTC](https://discuss.elastic.co/t/bug-in-bool-queries/14797/3 "2017-07-06T02:01:36Z")

</div>


