Percentiles aggregation yield different results between ES 1.7.x and 7.x

Let's create 3 products with sale_counts field:

PUT products/_mapping
{
  "properties": {
    "sales_count": {
      "type": "integer"
    }
  }
}
POST products/_doc/
{
  "sales_count" : 323,
}
POST products/_doc/
{
  "sales_count" : 323,
}
POST products/_doc/
{
  "sales_count" : 1000,
}

let's build sale percentiles aggregation bucket:

POST products/_search
{
  "query": {
    "bool": {
      "must": {
        "match_all": {}
      },
      "filter": []
    }
  },
  "aggregations": {
    "sales_percentiles": {
      "percentiles": {
        "field": "sales_count",
        "percents": [
          50,
          95,
          99
        ]
      }
    }
  },
  "from": 0,
  "size": 50,
  "timeout": "3000ms"
}

results are:

# ES 1.7.5
...
"aggregations": {
  "sales_percentiles": { "values": { "50.0": 323,"95.0": 932.3,"99.0": 1000}}
}
# ES 7.1.1
...
"aggregations": {
	"sales_percentiles": { "values": { "50.0": 323,"95.0": 1000,"99.0": 1000}}
}

the 95th percentile value is not the same between 2 ES versions.

I would like to ask if this is a bug.

Much thanks

Given that you have so few samples I would expect the response in ES7 and suspect it may be a bug in ES1.7. I can’t see how 932 could ever be an expected value there.

I think so too.

Thanks for confirming the hypothesis.

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