# Different results for same query

**URL:** <https://discuss.elastic.co/t/different-results-for-same-query/111757>\
**Category:** Elasticsearch\
**Created:** [December 14, 2017, 11:36am UTC](https://discuss.elastic.co/t/different-results-for-same-query/111757 "2017-12-14T11:36:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)\
**Post date:** [December 14, 2017, 11:36am UTC](https://discuss.elastic.co/t/different-results-for-same-query/111757/1 "2017-12-14T11:36:54Z")

</div>

Hi,

Using kibana 6.0.1.

I get different results when running the same question on the same data multiple times:

 ![grafik](https://us1.discourse-cdn.com/elastic/original/3X/b/a/ba736fca8443d8d91a773b2c91f2c45d2315369d.png)

 ![grafik](https://us1.discourse-cdn.com/elastic/original/3X/3/8/38ae8f88ce31d13dc5d1128deb5f454b5a70d5ee.png)

on left side the the value for 25th and 50th percentile havent been changed, although no new data has been inserted.

How comes?

Regards, Andreas

---

<div class="post-metadata">

**Author:** ![spalger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spalger/32/14092_2.png) [@spalger](https://discuss.elastic.co/u/spalger)\
**Post date:** [December 14, 2017, 8:53pm UTC](https://discuss.elastic.co/t/different-results-for-same-query/111757/2 "2017-12-14T20:53:04Z")

</div>

Checkout [https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-percentile-aggregation.html#search-aggregations-metrics-percentile-aggregation-approximation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-percentile-aggregation.html#search-aggregations-metrics-percentile-aggregation-approximation) or information about the algorythm elasticsearch uses to calculate percentiles at scale, and how it is generally best consider them approximations.

I'm not sure why that would lead to different values being produced on the exact same data (assuming you didn't reindex the data, which _might_ lead to slightly different sharding), but if you move the questing over to the elasticsearch section someone might be able to tell you.

---

<div class="post-metadata">

**Author:** ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)\
**Post date:** [December 18, 2017, 7:58am UTC](https://discuss.elastic.co/t/different-results-for-same-query/111757/3 "2017-12-18T07:58:45Z")

</div>

can anyone here can give more details? should i open a bug at github?

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [December 18, 2017, 9:36am UTC](https://discuss.elastic.co/t/different-results-for-same-query/111757/4 "2017-12-18T09:36:32Z")

</div>

The sequence in which the same set of documents are provided to the percentiles aggregation can lead to minor variations in results.  
The insertion sequence can be affected by:

1. Primary and replica shards having different physical arrangements of content on disk (Lucene merge operations are non-deterministic)
2. The sequence of merging results from multiple shards (again, a non-deterministic order)

---

<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:** [January 15, 2018, 9:36am UTC](https://discuss.elastic.co/t/different-results-for-same-query/111757/5 "2018-01-15T09:36:38Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
