documentation-website
documentation-website copied to clipboard
Update the example of the multiple terms aggregation by muliple orders.
Description
Update the example of the multiple terms aggregation.
Issues Resolved
Closes #7037
Checklist
- [x] By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and subject to the Developers Certificate of Origin. For more information on following Developer Certificate of Origin and signing off your commits, please check here.
I suggest we don't remove the original example, but add a new one. Because if it needs only 1 order, it could use original one. If we change document like this way, it could confuse the old order style is not supported. But it is not true, it can support both one order with {...}
or multiple order with [...]
.
I suggest we don't remove the original example, but add a new one. Because if it needs only 1 order, it could use original one. If we change document like this way, it could confuse the old order style is not supported. But it is not true, it can support both one order with
{...}
or multiple order with[...]
.
I got your point, but the current document is not correct. I am trying to fix it to make it accurate.
@bowenlan-amzn - What are your thoughts on this?
@bowenlan-amzn - What are your thoughts on this?
Please refer to the update in PR: https://github.com/opensearch-project/OpenSearch/pull/13400
Hi @dblock - Can you please comment with your thoughts? Thanks.
The current example is incorrect, if I understand correctly it has to be an array of orders, even with 1 order. There's no point in having an array of 1 and then another example with an array of 2, is there?
The current example is incorrect, if I understand correctly it has to be an array of orders, even with 1 order. There's no point in having an array of 1 and then another example with an array of 2, is there?
As far as I know, there is no example of array in the offical doc.
The current example is incorrect, if I understand correctly it has to be an array of orders, even with 1 order. There's no point in having an array of 1 and then another example with an array of 2, is there?
@dblock As current official document, the multi-term example is as below:
GET sample-index100/_search
{
"size": 0,
"aggs": {
"hot": {
"multi_terms": {
"terms": [{
"field": "region"
},{
"field": "host"
}],
"order": {"max-cpu": "desc"}
},
"aggs": {
"max-cpu": { "max": { "field": "cpu" } }
}
}
}
}
@Zhikai-VM wants to revise it as:
GET sample-index100/_search
{
"size": 0,
"aggs": {
"hot": {
"multi_terms": {
"terms": [{
"field": "region"
},{
"field": "host"
}],
"order": [ {"max-cpu": "desc"}, {"max-mem": "asc"}]
},
"aggs": {
"max-cpu": { "max": { "field": "cpu" } },
"max-mem": { "max": { "field": "mem"}}
}
}
}
}
to keep the official document accordance with this PR: https://github.com/opensearch-project/OpenSearch/pull/13400
Hi @dblock , what do you think about this? I prefer to use an array for the 'order' field. We can pass one order or multiple orders in this field.
Hi @dblock and @bowenlan-amzn, any thoughts on this PR?
This looks good to me, can we merge @hdhalter ?
Thanks @dblock @bowenlan-amzn!