mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-25 15:47:23 -04:00
Related to issue #77823 This does the following: - Updates several asciidoc files that contained code snippets with invalid JSON, most involving unnecessary trailing commas. - Makes the switch from the Groovy JSON parser to the Jackson parser, pursuant to the general goal of eliminating Groovy dependence. - Makes testing of JSON validity at build time more strict. Note that this update still allows backslash escaping for any character. Currently that matters because of the file "docs/reference/ml/anomaly-detection/apis/get-datafeed-stats.asciidoc", specifically this part: "attributes" : { "ml.machine_memory" : "$body.datafeeds.0.node.attributes.ml\.machine_memory", "ml.max_open_jobs" : "512" } It's not clear to me what change, if any, is appropriate there. So, I've left in the escaped period and configured the parser to ignore it for the time being.
39 lines
1.3 KiB
Text
39 lines
1.3 KiB
Text
[[search-aggregations-bucket-missing-aggregation]]
|
|
=== Missing aggregation
|
|
++++
|
|
<titleabbrev>Missing</titleabbrev>
|
|
++++
|
|
|
|
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,console,id=missing-aggregation-example]
|
|
--------------------------------------------------
|
|
POST /sales/_search?size=0
|
|
{
|
|
"aggs": {
|
|
"products_without_a_price": {
|
|
"missing": { "field": "price" }
|
|
}
|
|
}
|
|
}
|
|
--------------------------------------------------
|
|
// TEST[setup:sales]
|
|
|
|
In the above example, we get the total number of products that do not have a price.
|
|
|
|
Response:
|
|
|
|
[source,console-result]
|
|
--------------------------------------------------
|
|
{
|
|
...
|
|
"aggregations": {
|
|
"products_without_a_price": {
|
|
"doc_count": 0
|
|
}
|
|
}
|
|
}
|
|
--------------------------------------------------
|
|
// TESTRESPONSE[s/\.\.\./"took": $body.took,"timed_out": false,"_shards": $body._shards,"hits": $body.hits,/]
|