You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2009/04/24 22:34:56 UTC

[Solr Wiki] Update of "FieldCollapsing" by ChrisHarris

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The following page has been changed by ChrisHarris:
http://wiki.apache.org/solr/FieldCollapsing

The comment on the change is:
Some hints about how to get it working with solrconfig.xml

------------------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                     
  This topic was discussed a while ago: http://www.nabble.com/result-grouping--tf2910425.html#a8131895          
  
+ == Setup ==
+ 
+ To use field collapsing, you'll first need to install the patch. Then you'll need to edit your solrconfig.xml. First, register the collapse searchComponent like this:
+ 
+ {{{
+   <searchComponent name="collapse"     class="org.apache.solr.handler.component.CollapseComponent" />
+ }}}
+ 
+ Then reference that search component in a custom search handler. For example, you could modify the standard request handler to look like this:
+ 
+ {{{
+   <requestHandler name="standard" class="solr.SearchHandler" default="true">
+     <!-- default values for query parameters -->
+      <lst name="defaults">
+        <str name="echoParams">explicit</str>
+    
+      </lst>
+      <arr name="components">
+ 	<str>collapse</str>
+ 	<str>facet</str>
+ 	<str>highlight</str>
+ 	<str>debug</str>
+      </arr>
+   </requestHandler>
+ }}}
+ 
+ Note that we have not included "query" in the list of component; the collapse handler implements query functionality itself.
  
  == Parameters ==
  
  
  || '''param''' || '''description''' ||
+ || collapse || Set this to true to enable collapsing. ||
  || collapse.type || normal/adjacent -- does this collapse all fields or just the ones that are next to each other ||
  || collapse.field || Which field to collapse ||
  || collapse.max   || How many results to show for the collapsed field. ||