Clarification on buckets for range aggregation

I just wanted some clarification on what data would be included in my buckets if I did a range aggregation, it was not clear to me in reading the documentation (Range aggregation | Elasticsearch Reference [7.12] | Elastic).

Say I have the following example:

GET /_search
{
  "aggs": {
    "price_ranges": {
      "range": {
        "field": "price",
        "ranges": [
          { "from": 0.0, "to": 100.0 },
          { "from": 100.0, "to": 200.0 },
          { "from": 200.0 }
        ]
      }
    }
  }
}

I was wondering if I had the prices of 100.00 and 200.00 which bucket would it fall into? I'm just hoping that these prices don't fall into two buckets.

The real reason I ask is that I have a table in Kibana where I am split a field into time ranges as follows:

I just want to make sure I'm not double counting anything if it falls right on the border.

Mike

See Range Aggregation

Note that this aggregation includes the from value and excludes the to value for each range

So you can think of this are

greater than or equal to 0 to less than 10
greater than or equal to 10 to less than 20

and so on...

so 9.99 will go in the first bucket.
so 10.0 will go in the 2nd bucket

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