OpenSearch/docs/reference/search/aggregations/bucket/missing-aggregation.asciidoc
Florian Gilcher eed079aaac Reference docs fixes
* Make it clearer that `aggs` is an allowed synomym
  for the `aggregations` key
* Fix broken example in for datehistogram, `1.5M` is
  not an allowed interval
* Make use of colon before examples consistent
* Fix typos
2014-01-20 12:14:17 +01:00

34 lines
1.1 KiB
Plaintext

[[search-aggregations-bucket-missing-aggregation]]
=== Missing
A field data based single bucket aggregation, that creates a bucket of all documents in the current document set context that are missing a field value (effectively, missing a field or having the configured NULL value set). This aggregator will often be used in conjunction with other field data bucket aggregators (such as ranges) to return information for all the documents that could not be placed in any of the other buckets due to missing field data values.
Example:
[source,js]
--------------------------------------------------
{
"aggs" : {
"products_without_a_price" : {
"missing" : { "field" : "price" }
}
}
}
--------------------------------------------------
In the above example, we calculate the average price of all the products that are currently in-stock.
Response:
[source,js]
--------------------------------------------------
{
...
"aggs" : {
"products_without_a_price" : {
"doc_count" : 10
}
}
}
--------------------------------------------------