<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>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # Children Aggregation 一種特殊的單桶聚合,可以將父文檔類型上的桶聚合到子文檔上。 此聚合依賴于映射中的[_parent](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-parent-field.html)字段。 此聚合有一個選項: * type -?應該映射到父空間中的子類型的buckets(桶) 例如,假設我們有一個問題和答案的索引。 答案類型在映射中具有以下_parent字段 | `PUT child_example` `{` `"mappings": {` `"answer" : {` `"_parent" : {` `"type" : "question"` `}` `}` `}` `}` | 問題類型的文檔包含標簽字段,答案類型的文檔包含所有者字段。 使用子集合,即使兩個字段存在于兩種不同類型的文檔中,標記桶也可以在單個請求中映射到所有者桶。 一個問題類型文檔的例子 | `PUT child_example/question/1` `{` `"body": "<p>I have Windows 2003 server and i bought a new Windows 2008 server...",` `"title": "Whats the best way to file transfer my site from server to a newer one?",` `"tags": [` `"windows-server-2003",` `"windows-server-2008",` `"file-transfer"` `]` `}` | 回答類型文件的例子: | `PUT child_example/answer/1?parent=1&refresh` `{` `"owner": {` `"location": "Norfolk, United Kingdom",` `"display_name": "Sam",` `"id": 48` `},` `"body": "<p>Unfortunately you're pretty much limited to FTP...",` `"creation_date": "2009-05-04T13:45:37.030"` `}` `PUT child_example/answer/2?parent=1&refresh` `{` `"owner": {` `"location": "Norfolk, United Kingdom",` `"display_name": "Troll",` `"id": 49` `},` `"body": "<p>Use Linux...",` `"creation_date": "2009-05-05T13:45:37.030"` `}` | 可以構建將兩者連接在一起的以下請求: | `POST child_example/_search?size=0` `{` `"aggs": {` `"top-tags": {` `"terms": {` `"field": "tags.keyword",` `"size": 10` `},` `"aggs": {` `"to-answers": {` `"children": {` `"type" : "answer"? #1` `},` `"aggs": {` `"top-names": {` `"terms": {` `"field": "owner.display_name.keyword",` `"size": 10` `}` `}` `}` `}` `}` `}` `}` `}` | #1?**type**?指向使用名稱為**answer**的?type / mapping 以上示例返回頂級問題標簽和每個標簽的頂級答案所有者。 下面是可能的返回結果: | `{` `"timed_out": false,` `"took": 25,` `"_shards": { "total": 5, "successful": 5, "failed": 0 },` `"hits": { "total": 3, "max_score": 0.0, hits: [] },` `"aggregations": {` `"top-tags": {` `"doc_count_error_upper_bound": 0,` `"sum_other_doc_count": 0,` `"buckets": [` `{` `"key": "file-transfer",` `"doc_count": 1, #1` `"to-answers": {` `"doc_count": 2, #2` `"top-names": {` `"doc_count_error_upper_bound": 0,` `"sum_other_doc_count": 0,` `"buckets": [` `{` `"key": "Sam",` `"doc_count": 1` `},` `{` `"key": "Troll",` `"doc_count": 1` `}` `]` `}` `}` `},` `{` `"key": "windows-server-2003",` `"doc_count": 1, #3` `"to-answers": {` `"doc_count": 2, #4` `"top-names": {` `"doc_count_error_upper_bound": 0,` `"sum_other_doc_count": 0,` `"buckets": [` `{` `"key": "Sam",` `"doc_count": 1` `},` `{` `"key": "Troll",` `"doc_count": 1` `}` `]` `}` `}` `},` `{` `"key": "windows-server-2008",` `"doc_count": 1, #5` `"to-answers": {` `"doc_count": 2, #6` `"top-names": {` `"doc_count_error_upper_bound": 0,` `"sum_other_doc_count": 0,` `"buckets": [` `{` `"key": "Sam",` `"doc_count": 1` `},` `{` `"key": "Troll",` `"doc_count": 1` `}` `]` `}` `}` `}` `]` `}` `}` `}` | #1 ?帶有file-transfer,windows-server-2003等標簽問題文檔數量 #3 #5 #2 ?帶有`file-transfer`,?`windows-server-2003等標簽的與問題文檔相關的答復文檔的數量` #4 #6
                  <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>

                              哎呀哎呀视频在线观看