opensearch-project / documentation-website

The documentation for OpenSearch, OpenSearch Dashboards, and their associated plugins.

Home Page:https://opensearch.org/docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[DOC] Update the document for multiple terms aggregation

Zhikai-VM opened this issue · comments

  • Request a change to existing documentation
  • Add new documentation
  • Report a technical problem with the documentation
  • Other

The current document about the multiple terms aggregation is not accurate. In the document(https://opensearch.org/docs/latest/aggregations/bucket/multi-terms/), it gives an example. And it implies that multiple terms aggregation only accepts one order. But in fact, it accepts multiple orders like the following:

GET sample-index100/_search
{
  "size": 0, 
  "aggs": {
    "hot": {
      "multi_terms": {
        "terms": [{
          "field": "region" 
        },{
          "field": "host" 
        }],
        "order":[ {"max-cpu": "desc"},  {"max-memory": "desc"}] <=== multiple orders
      },
      "aggs": {
        "max-cpu": { "max": { "field": "cpu" } },
        "max-memory":  { "max": { "field": "memory" } }
      }      
    }
  }
}

Please help to update the document, and I think this is an important and valuable feature for the multiple terms aggregation.