[ https://issues.apache.org/jira/browse/SOLR-3973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13481198#comment-13481198 ]
ZhengBowen commented on SOLR-3973: ---------------------------------- We often come across the scene of the multi-faceted cross, For example, the SQL statement, select count( * ) from table group by A,B. so, this patch is to surport faceting on multiple columns, and you can get the counts result of multi-faceted cross. i come from alipay in china, we use Solr to build multidimensional analysis platform for mass data. > Cross facet, faceting on multiple columns. > ------------------------------------------ > > Key: SOLR-3973 > URL: https://issues.apache.org/jira/browse/SOLR-3973 > Project: Solr > Issue Type: Improvement > Components: SearchComponents - other > Affects Versions: 3.5 > Reporter: ZhengBowen > Labels: cross, facet, solr > Fix For: 3.5 > > Attachments: crossfacet.patch > > > We often come across the scene of the multi-faceted cross, For example, the > SQL statement, select count( * ) from table group by A,B. > Now we slightly modified for FacetComponent, this component to be able to > support the multi-faceted cross.you can facet on multiple columns, and get > the count result of multi-faceted cross. > Request parameters are as follows: > &start=0&rows=0&q=*:*&facet=true&facet.field=user_city&facet.field=user_province&facet.limit=10&facet.cross=true&facet.cross.sep=, > The original effect is as follows: > <result name="response" numFound="479140" start="0" sum="0.0" max="-Infinity" > min="Infinity"/> > <lst name="facet_counts"> > <lst name="facet_queries"/> > <lst name="facet_fields"> > <lst name="user_city"> > <int name="Beijing">16852</int> > <int name="ShangHai">16787</int> > <int name="Gunagzhou">12950</int> > <int name="Shenzhen">11667</int> > <int name="Hangzhou">9997</int> > <int name="Chongqing">7624</int> > <int name="Chengdu">7082</int> > <int name="Wuhan">6894</int> > <int name="Suzhou">6528</int> > <int name="Tianjin">5822</int> > </lst> > <lst name="user_province"> > <int name="Gunagdong">48621</int> > <int name="Zhengjiang">34634</int> > <int name="Jiangsu">28748</int> > <int name="Shandong">20389</int> > <int name="Fujian">18508</int> > <int name="Beijing">16852</int> > <int name="Shanghai">16787</int> > <int name="Hubei">15227</int> > <int name="Sichuan">15112</int> > <int name="Hebei">13793</int> > </lst> > </lst> > <lst name="facet_numTerms"/> > <lst name="facet_dates"/> > <lst name="facet_ranges"/> > </lst> > The effect of the new features are as follows: > <result name="response" numFound="479140" start="0" sum="0.0" max="-Infinity" > min="Infinity"/> > <lst name="facet_counts"> > <lst name="facet_queries"/> > <lst name="facet_fields"> > <lst name="user_city,user_province"> > <int name="Beijing,Beijing">16852</int> > <int name="Shanghai,Shanghai">16787</int> > <int name="Guangzhou,Gunagdong">12950</int> > <int name="Shenzheng,Guangdong">11667</int> > <int name="Hangzhou,Zhejiang">9997</int> > <int name="Chongqing,Chongqing">7624</int> > <int name="Chengdu,Sichuan">7082</int> > <int name="Wuhan,Hubei">6894</int> > <int name="Suzhou,Jiangsu">6528</int> > </lst> > </lst> > <lst name="facet_numTerms"/> > <lst name="facet_dates"/> > <lst name="facet_ranges"/> > </lst> > </response> -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org