# Aggregation vs Search/Filter discrepancy - caching issue?

**URL:** <https://discuss.elastic.co/t/aggregation-vs-search-filter-discrepancy-caching-issue/17881>\
**Category:** Elasticsearch\
**Created:** [June 3, 2014, 10:06am UTC](https://discuss.elastic.co/t/aggregation-vs-search-filter-discrepancy-caching-issue/17881 "2014-06-03T10:06:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mooky](https://avatars.discourse-cdn.com/v4/letter/m/43a26b/32.png) [@mooky](https://discuss.elastic.co/u/mooky)\
**Post date:** [June 3, 2014, 10:06am UTC](https://discuss.elastic.co/t/aggregation-vs-search-filter-discrepancy-caching-issue/17881/1 "2014-06-03T10:06:13Z")

</div>

I have a test that indexes some data, does an aggregation + search to  
verify the results.  
Then my test changes 1 piece of data and re-indexes (everything).  
refresh() is called.

Then I do an aggregation + search again to verify my results.  
The search results are correct (ie updated to reflect the changed data).  
The aggregation results are not correct - they are the same as the first  
aggregation results - implying the data has not changed.  
The aggregation results go wrong at the result of a filter aggregation. The  
results of the filter aggregation give a count of 2 - the results of the  
search (equiv query or _same_ filter) give 1.

Suspecting a caching issue (e.g. filter caching) I then made sure I flushed  
the caches for that index. But sadly, the problem still persists.

I am kinda running out of ideas. Can anyone suggest what to check next?

--  
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/61140ef1-441f-477d-8129-d30588b6838b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/61140ef1-441f-477d-8129-d30588b6838b%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![mooky](https://avatars.discourse-cdn.com/v4/letter/m/43a26b/32.png) [@mooky](https://discuss.elastic.co/u/mooky)\
**Post date:** [June 3, 2014, 11:00am UTC](https://discuss.elastic.co/t/aggregation-vs-search-filter-discrepancy-caching-issue/17881/2 "2014-06-03T11:00:02Z")

</div>

Update elastic to 1.2 - still seeing the same issue...

--  
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/2805708d-57dd-4977-a17c-2c27d9ee98d0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2805708d-57dd-4977-a17c-2c27d9ee98d0%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [June 3, 2014, 8:42pm UTC](https://discuss.elastic.co/t/aggregation-vs-search-filter-discrepancy-caching-issue/17881/3 "2014-06-03T20:42:49Z")

</div>

Can you share your test case?

On Tue, Jun 3, 2014 at 1:00 PM, mooky [nick.minutello@gmail.com](mailto:nick.minutello@gmail.com) wrote:

> Update elastic to 1.2 - still seeing the same issue...
> 
> --  
> 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/2805708d-57dd-4977-a17c-2c27d9ee98d0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2805708d-57dd-4977-a17c-2c27d9ee98d0%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/2805708d-57dd-4977-a17c-2c27d9ee98d0%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/2805708d-57dd-4977-a17c-2c27d9ee98d0%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
Adrien Grand

--  
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/CAL6Z4j7T%2B%3DgXO%2BGHGFw11RBjpTOkXCUJ%2Bz2yVauU\_YOo6Pmwxg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j7T%2B%3DgXO%2BGHGFw11RBjpTOkXCUJ%2Bz2yVauU_YOo6Pmwxg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![mooky](https://avatars.discourse-cdn.com/v4/letter/m/43a26b/32.png) [@mooky](https://discuss.elastic.co/u/mooky)\
**Post date:** [June 4, 2014, 11:24am UTC](https://discuss.elastic.co/t/aggregation-vs-search-filter-discrepancy-caching-issue/17881/4 "2014-06-04T11:24:29Z")

</div>

Turns out it was user error. Please ignore.

--  
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/81ca5558-4fd3-44cd-ae72-4490145fa905%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/81ca5558-4fd3-44cd-ae72-4490145fa905%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:24am UTC](https://discuss.elastic.co/t/aggregation-vs-search-filter-discrepancy-caching-issue/17881/5 "2017-07-06T01:24:44Z")

</div>


