From e95a713d1fd79e8044e3fad89b0cabed418c507d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 14 May 2024 15:08:08 +0000 Subject: [PATCH] Update the example of the multiple terms aggregation by muliple orders. (#7039) Signed-off-by: Zhikai Chen (cherry picked from commit 927ca934369cdfd4967ff0368df8cd30271a45e0) Signed-off-by: github-actions[bot] --- _aggregations/bucket/multi-terms.md | 35 +++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/_aggregations/bucket/multi-terms.md b/_aggregations/bucket/multi-terms.md index eb779e7c48..6fca528b38 100644 --- a/_aggregations/bucket/multi-terms.md +++ b/_aggregations/bucket/multi-terms.md @@ -38,10 +38,15 @@ GET sample-index100/_search },{ "field": "host" }], - "order": {"max-cpu": "desc"} + "order": [{ + "max-cpu": "desc" + },{ + "max-memory": "desc" + }] }, "aggs": { - "max-cpu": { "max": { "field": "cpu" } } + "max-cpu": { "max": { "field": "cpu" } }, + "max-memory": { "max": { "field": "memory" } } } } } @@ -83,6 +88,23 @@ GET sample-index100/_search "doc_count": 2, "max-cpu": { "value": 90.0 + }, + "max-memory": { + "value": 50.0 + } + }, + { + "key": [ + "dub1", + "h1" + ], + "key_as_string": "dub|h1", + "doc_count": 2, + "max-cpu": { + "value": 90.0 + }, + "max-memory": { + "value": 40.0 } }, { @@ -94,6 +116,9 @@ GET sample-index100/_search "doc_count": 2, "max-cpu": { "value": 70.0 + }, + "max-memory": { + "value": 90.0 } }, { @@ -105,6 +130,9 @@ GET sample-index100/_search "doc_count": 2, "max-cpu": { "value": 50.0 + }, + "max-memory": { + "value": 50.0 } }, { @@ -116,6 +144,9 @@ GET sample-index100/_search "doc_count": 2, "max-cpu": { "value": 15.0 + }, + "max-memory": { + "value": 20.0 } } ]