<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # Max Bucket Aggregation 原文鏈接 : [https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-aggregations-pipeline-max-bucket-aggregation.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-aggregations-pipeline-max-bucket-aggregation.html) 譯文鏈接 : [Max Bucket Aggregation](/display/Elasticsearch/Max+Bucket+Aggregation) 貢獻者 : @蘇濤,[ApacheCN](/display/~apachecn),[Apache中文網](/display/~apachechina) 警告 此功能是實驗性的,可能會在將來的版本中完全更改或刪除。Elastic將采取最大的努力來解決此問題,但實驗功能不受SLA官方功能的支持。 最大值桶聚合所定義的桶包含一組聚合指定度量的最大值,并且同時輸出桶的鍵和值。指定的度量必須是數字并且這個聚合必須是多桶聚合。 ### 語法 `max_bucket`?聚合結構如下: ``` { "max_bucket": { "buckets_path": "the_sum" } } ``` `max_bucket`?參數如下: | 參數名稱 | 描述 | 是否必填 | 默認值 | | --- | --- | --- | --- | | buckets_path | 想要計算最大值的桶路徑,點擊?[the section called “`buckets_path`?Syntax](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-aggregations-pipeline.html#buckets-path-syntax "buckets_path Syntaxedit")[edit](https://github.com/elastic/elasticsearch/edit/5.4/docs/reference/aggregations/pipeline.asciidoc "Edit this page on GitHub")”查看更多細節 | 必填 | ? | | gap_policy | 當數據缺口出現時采用的策略,點擊[the section called “Dealing with gaps in the data](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-aggregations-pipeline.html#gap-policy "Dealing with gaps in the dataedit")[edit](https://github.com/elastic/elasticsearch/edit/5.4/docs/reference/aggregations/pipeline.asciidoc "Edit this page on GitHub")”查看更多細節 | 可選 | skip | | format | 用于規范聚合輸出值的格式 | 可選 | null | 以下代碼段計算每月總銷售額的最大值: ``` POST /sales/_search { "size": 0, "aggs" : { "sales_per_month" : { "date_histogram" : { "field" : "date", "interval" : "month" }, "aggs": { "sales": { "sum": { "field": "price" } } } }, "max_monthly_sales": { "max_bucket": { "buckets_path": "sales_per_month>sales" #1 } } } } ``` | 1 | buckets_path指示這個max_bucket聚合是要得到sales_per_month日期直方圖中sales聚合的最大值。 | 可能得到如下的響應: ``` { "took": 11, "timed_out": false, "_shards": ..., "hits": ..., "aggregations": { "sales_per_month": { "buckets": [ { "key_as_string": "2015/01/01 00:00:00", "key": 1420070400000, "doc_count": 3, "sales": { "value": 550.0 } }, { "key_as_string": "2015/02/01 00:00:00", "key": 1422748800000, "doc_count": 2, "sales": { "value": 60.0 } }, { "key_as_string": "2015/03/01 00:00:00", "key": 1425168000000, "doc_count": 2, "sales": { "value": 375.0 } } ] }, "max_monthly_sales": { "keys": ["2015/01/01 00:00:00"], #1 "value": 550.0 } } } ``` | 1 | key是字符串數組,因為最大值可能存在于多個存儲桶中 |
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看