久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

      <small id='eONts'></small><noframes id='eONts'>

        <bdo id='eONts'></bdo><ul id='eONts'></ul>
      <legend id='eONts'><style id='eONts'><dir id='eONts'><q id='eONts'></q></dir></style></legend>

      1. <tfoot id='eONts'></tfoot>
        <i id='eONts'><tr id='eONts'><dt id='eONts'><q id='eONts'><span id='eONts'><b id='eONts'><form id='eONts'><ins id='eONts'></ins><ul id='eONts'></ul><sub id='eONts'></sub></form><legend id='eONts'></legend><bdo id='eONts'><pre id='eONts'><center id='eONts'></center></pre></bdo></b><th id='eONts'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='eONts'><tfoot id='eONts'></tfoot><dl id='eONts'><fieldset id='eONts'></fieldset></dl></div>

        如何對 Solr 中的多個字段執行嵌套聚合?

        How to perform nested aggregation on multiple fields in Solr?(如何對 Solr 中的多個字段執行嵌套聚合?)

        <i id='fPkf0'><tr id='fPkf0'><dt id='fPkf0'><q id='fPkf0'><span id='fPkf0'><b id='fPkf0'><form id='fPkf0'><ins id='fPkf0'></ins><ul id='fPkf0'></ul><sub id='fPkf0'></sub></form><legend id='fPkf0'></legend><bdo id='fPkf0'><pre id='fPkf0'><center id='fPkf0'></center></pre></bdo></b><th id='fPkf0'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='fPkf0'><tfoot id='fPkf0'></tfoot><dl id='fPkf0'><fieldset id='fPkf0'></fieldset></dl></div>

        <small id='fPkf0'></small><noframes id='fPkf0'>

          • <tfoot id='fPkf0'></tfoot>
              <bdo id='fPkf0'></bdo><ul id='fPkf0'></ul>

              <legend id='fPkf0'><style id='fPkf0'><dir id='fPkf0'><q id='fPkf0'></q></dir></style></legend>

                    <tbody id='fPkf0'></tbody>

                1. 本文介紹了如何對 Solr 中的多個字段執行嵌套聚合?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在嘗試以嵌套方式按多個字段執行搜索結果聚合(計數和總和)分組.

                  I am trying to perform search result aggregation (count and sum) grouping by several fields in a nested fashion.

                  例如,使用本文末尾顯示的架構,我希望能夠獲得按類別"分組并按子類別"進一步分組的大小"總和,并得到類似這個:

                  For example, with the schema shown at the end of this post, I'd like to be able to get the sum of "size" grouped by "category" and sub-grouped further by "subcategory" and get something like this:

                  <category name="X">
                    <subcategory name="X_A">
                      <size sum="..." />
                    </subcategory>
                    <subcategory name="X_B">
                      <size sum="..." />
                    </subcategory>
                  </category>
                  ....
                  

                  我主要關注 Solr 的 Stats 組件,據我所知,它不允許嵌套聚合.

                  I've been looking primarily at Solr's Stats component which, as far as I can see, doesn't allow nested aggregation.

                  如果有人知道使用或不使用 Stats 組件的某種方式來實現這一點,我將不勝感激.

                  I'd appreciate it if anyone knows of some way to implement this, with or without the Stats component.

                  這是目標架構的精簡版:

                  Here is a cut-down version of the target schema:

                  <types>
                    <fieldType name="string" class="solr.StrField" />
                    <fieldType name="text" class="solr.TextField">
                      <analyzer><tokenizer class="solr.StandardTokenizerFactory" /></analyzer>
                    </fieldType>
                    <fieldType name="date" class="solr.DateField" />
                    <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0" />
                  </types>
                  
                  <fields>
                    <field name="id" type="string" indexed="true" stored="true" />
                    <field name="category" type="text" indexed="true" stored="true" />
                    <field name="subcategory" type="text" indexed="true" stored="true" />
                    <field name="pdate" type="date" indexed="true" stored="true" />
                    <field name="size" type="int" indexed="true" stored="true" />
                  </fields>
                  

                  推薦答案

                  Solr 5.1 中新的 faceting 模塊可以做到這一點,它被添加到 https://issues.apache.org/jira/browse/SOLR-7214

                  The new faceting module in Solr 5.1 can do this, it was added in https://issues.apache.org/jira/browse/SOLR-7214

                  以下是如何將 sum(size) 添加到每個構面桶,并按該統計數據降序排序.

                  Here is how you would add sum(size) to every facet bucket, and sort descending by that statistic.

                  json.facet={
                    categories:{terms:{
                      field:category,
                      sort:"total_size desc",  // this will sort the facet buckets by your stat 
                      facet:{
                        total_size:"sum(size)"  // this calculates the stat per bucket
                      }
                    }}
                  }
                  

                  這就是您在子類別中添加子方面的方式:

                  And this is how you would add in the subfacet on subcategory:

                  json.facet={
                    categories:{terms:{
                      field:category,
                      sort:"total_size desc",
                      facet:{
                        total_size:"sum(size)",
                        subcat:{terms:{ // this will facet on the subcategory field for each bucket
                          field:subcategory,
                          facet:{
                           sz:"sum(size)"  // this calculates the sum per sub-cat bucket          
                        }}
                      }
                    }}
                  }
                  

                  因此,以上內容將為您提供類別和子類別級別的總和(大小).新 facet 模塊的文檔目前位于 http://yonik.com/json-facet-api/

                  So the above will give you the sum(size) at both the category and subcategory levels. Documentation for the new facet module is currently at http://yonik.com/json-facet-api/

                  這篇關于如何對 Solr 中的多個字段執行嵌套聚合?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How can I detect integer overflow on 32 bits int?(如何檢測 32 位 int 上的整數溢出?)
                  Local variables before return statements, does it matter?(return 語句之前的局部變量,這有關系嗎?)
                  How to convert Integer to int?(如何將整數轉換為整數?)
                  How do I create an int array with randomly shuffled numbers in a given range(如何在給定范圍內創建一個隨機打亂數字的 int 數組)
                  Inconsistent behavior on java#39;s ==(java的行為不一致==)
                  Why is Java able to store 0xff000000 as an int?(為什么 Java 能夠將 0xff000000 存儲為 int?)
                  1. <small id='3Pa2I'></small><noframes id='3Pa2I'>

                    • <bdo id='3Pa2I'></bdo><ul id='3Pa2I'></ul>

                        <tbody id='3Pa2I'></tbody>
                      <tfoot id='3Pa2I'></tfoot>
                      <i id='3Pa2I'><tr id='3Pa2I'><dt id='3Pa2I'><q id='3Pa2I'><span id='3Pa2I'><b id='3Pa2I'><form id='3Pa2I'><ins id='3Pa2I'></ins><ul id='3Pa2I'></ul><sub id='3Pa2I'></sub></form><legend id='3Pa2I'></legend><bdo id='3Pa2I'><pre id='3Pa2I'><center id='3Pa2I'></center></pre></bdo></b><th id='3Pa2I'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='3Pa2I'><tfoot id='3Pa2I'></tfoot><dl id='3Pa2I'><fieldset id='3Pa2I'></fieldset></dl></div>
                        <legend id='3Pa2I'><style id='3Pa2I'><dir id='3Pa2I'><q id='3Pa2I'></q></dir></style></legend>

                            主站蜘蛛池模板: 亚洲日本一区二区三区四区 | 亚洲一视频 | 亚洲国产一区二区三区 | 成人在线免费视频 | 久久a久久| 欧美亚洲国产日韩 | 毛片一级网站 | 国产区免费视频 | 亚洲一本 | 亚洲高清成人 | 日韩一区二区三区在线视频 | 国产精品久久国产精品久久 | 国产视频线观看永久免费 | 91视在线国内在线播放酒店 | 国产乱码久久久 | 超碰人人91| 一级大片 | 99福利视频| 国产999精品久久久久久 | 国产乱人伦精品一区二区 | 久久精点视频 | 人人操日日干 | 亚洲欧美日韩高清 | 国产精品日本一区二区在线播放 | 久久在线 | 亚洲欧美网站 | www.日韩欧美| 中文字幕第二区 | 91一区二区 | 日韩成人在线观看 | 亚洲午夜av久久乱码 | 亚洲精品国产综合区久久久久久久 | 日韩久久久久久 | 国产剧情一区二区三区 | 免费av在线 | 欧美一级片 | 成人精品久久 | 日韩一区和二区 | 精品久久精品 | 亚洲色图综合 | a爱视频|