Hello,
Is there a way to include missing fields in filters aggregation like in terms aggregation?
Thanks,
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.
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.
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.
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.