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 2007/06/04 04:11:27 UTC

[Solr Wiki] Update of "FieldCollapsing" by ryan

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 ryan:
http://wiki.apache.org/solr/FieldCollapsing

New page:
= Field Collapsing =                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                   
/!\ This referes to functionality from [[https://issues.apache.org/jira/browse/SOLR-236 SOLR-236]]                                                                                                                                                                                                                                                                 
                                                                                                                                                                                                                                                                                                                                                                   
This patch is not complete, but it will be useful to keep this page updated while the interface evolves.                                                                                                                                                                                                                                                           
                                                                                                                                                                                                                                                                                                                                                                   
>>From [[http://www.fastsearch.com/glossary.aspx?m=48&amid=299 fast search]]                                                                                                                                                                                                                                                                                         
{{{                                                                                                                                                                                                                                                                                                                                                                
"Used in order to collapse a group of results with similar value for a given field to a single entry in the result set. Site collapsing is a special case of this, where all results for a given web site is collapsed into one or two entries in the result set, typically with an associated "more documents from this site" link. See also Duplicate detection."
}}}                                                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                   
This topic was disicussed a while ago: http://www.nabble.com/result-grouping--tf2910425.html#a8131895                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                                                                                                                   
|| '''param'''    || '''description''' ||                                                                                                                                                                                                                                                                                                                          
|| 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. ||                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                                                                                                                   
=== Examples ===                                                                                                                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                                                                                                                   
Using the example data:                                                                                                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                                                                                                   
Collapse all documents using 'cat' and 'normal' collapse type:                                                                                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                                                                                                                   
http://localhost:8983/solr/select/?q=*:*&collapse.field=cat&collapse.max=1&collapse.type=normal                                                                                                                                                                                                                                                                    
{{{                                                                                                                                                                                                                                                                                                                                                                
<lst name="collapse_counts">                                                                                                                                                                                                                                                                                                                                       
 <int name="hard">1</int>                                                                                                                                                                                                                                                                                                                                           
 <int name="electronics">2</int>                                                                                                                                                                                                                                                                                                                                    
 <int name="memory">2</int>                                                                                                                                                                                                                                                                                                                                         
 <int name="monitor">1</int>                                                                                                                                                                                                                                                                                                                                        
 <int name="software">1</int>                                                                                                                                                                                                                                                                                                                                       
</lst>                                                                                                                                                                                                                                                                                                                                                             
}}}                                  


http://localhost:8983/solr/select/?q=*:*&collapse.field=cat&collapse.max=1&collapse.type=adjacent
{{{
<lst name="collapse_counts">
 <int name="hard">1</int>
 <int name="electronics">1</int>
 <int name="memory">2</int>
 <int name="monitor">1</int>
</lst>         
}}}