Skip to content

missing value not considered in min/max aggregations #48905

Closed
@mattweber

Description

@mattweber

The missing value is not considered in min/max aggreagtions in es7 as they were in previous versions and I don't see this documented as a breaking change. I believe this is due optimization of using segment min/max values.

To reproduce run the following against es6 and es7. The missing values should be returned as the min and max value of the aggregation.

curl -XPUT -H"Content-Type: application/json" 'localhost:9200/testmissing/_doc/1' -d '{"title": "with value", "value": 1}'
curl -XPUT -H"Content-Type: application/json" 'localhost:9200/testmissing/_doc/2?refresh' -d '{"title": "missing value"}'
curl -XPOST -H"Content-Type: application/json" 'localhost:9200/testmissing/_search?pretty' -d '{
    "size": 0,
    "aggs": {
        "min_missing": {
            "min": {
                "field": "value",
                "missing": -1
            }
        },
        "max_missinng": {
            "max": {
                "field": "value",
                "missing": 2
            }
        }
    }
}'

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions