diff --git a/docs/content/querying/post-aggregations.md b/docs/content/querying/post-aggregations.md index f450a5077e0..6cfe1078bac 100644 --- a/docs/content/querying/post-aggregations.md +++ b/docs/content/querying/post-aggregations.md @@ -162,14 +162,35 @@ The format of the query JSON is as follows: "postAggregations" : [{ "type" : "arithmetic", "name" : "average", + "fn" : "/", + "fields" : [ + { "type" : "fieldAccess", "name" : "tot", "fieldName" : "tot" }, + { "type" : "fieldAccess", "name" : "rows", "fieldName" : "rows" } + ] + }] + ... +} +``` + + +```json +{ + ... + "aggregations" : [ + { "type" : "doubleSum", "name" : "tot", "fieldName" : "total" }, + { "type" : "doubleSum", "name" : "part", "fieldName" : "part" } + ], + "postAggregations" : [{ + "type" : "arithmetic", + "name" : "part_percentage", "fn" : "*", "fields" : [ { "type" : "arithmetic", - "name" : "div", + "name" : "ratio", "fn" : "/", "fields" : [ - { "type" : "fieldAccess", "name" : "tot", "fieldName" : "tot" }, - { "type" : "fieldAccess", "name" : "rows", "fieldName" : "rows" } + { "type" : "fieldAccess", "name" : "part", "fieldName" : "part" }, + { "type" : "fieldAccess", "name" : "tot", "fieldName" : "tot" } ] }, { "type" : "constant", "name": "const", "value" : 100 }