Visualization: Display missing values on filter aggregation

Hello,

Is there a way to include missing fields in filters aggregation like in terms aggregation?

Thanks,

You could nest https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-missing-aggregation.html under your terms agg?

Could you post your terms agg and also what you want the final response to look like? Just take the term agg response and edit it by hand, showing what you want to achieve.

@Emanuil,

missing aggregation is deprecated from ES. I already got it using the filter below on filters aggregation. Our use case favors filters agg for flexibility than term agg.

{"bool":{"must_not":{"exists":{"field":"{value}"}}}}

Thank you.

1 Like

Thanks a lot for coming back to post your solution!

Where did you get this?
The following code does not produce any deprecation notice AFAIK.

DELETE /sales
PUT /sales/_doc/1
{
  "foo": "bar",
  "price": 10
}
PUT /sales/_doc/2
{
  "foo": "bar"
}
POST /sales/_search?size=0
{
    "aggs" : {
        "products_without_a_price" : {
            "missing" : { "field" : "price" }
        }
    }
}

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