org.apache.solr.search
Class CollapsingQParserPlugin

java.lang.Object
  extended by org.apache.solr.search.QParserPlugin
      extended by org.apache.solr.search.CollapsingQParserPlugin
All Implemented Interfaces:
SolrInfoMBean, NamedListInitializedPlugin

public class CollapsingQParserPlugin
extends QParserPlugin

The CollapsingQParserPlugin is a PostFilter that performs field collapsing. This is a high performance alternative to standard Solr field collapsing (with ngroups) when the number of distinct groups in the result set is high.

Sample syntax:

Collapse based on the highest scoring document:

fq=(!collapse field=field_name}

Collapse based on the min value of a numeric field:

fq={!collapse field=field_name min=field_name}

Collapse based on the max value of a numeric field:

fq={!collapse field=field_name max=field_name}

Collapse with a null policy:

fq={!collapse field=field_name nullPolicy=nullPolicy}

There are three null policies:
ignore : removes docs with a null value in the collapse field (default).
expand : treats each doc with a null value in the collapse field as a separate group.
collapse : collapses all docs with a null value into a single group using either highest score, or min/max.

The CollapsingQParserPlugin fully supports the QueryElevationComponent


Nested Class Summary
static class CollapsingQParserPlugin.CollapseScore
           
 class CollapsingQParserPlugin.CollapsingPostFilter
           
 
Nested classes/interfaces inherited from interface org.apache.solr.core.SolrInfoMBean
SolrInfoMBean.Category
 
Field Summary
static String NAME
           
static String NULL_COLLAPSE
           
static String NULL_EXPAND
           
static String NULL_IGNORE
           
 
Fields inherited from class org.apache.solr.search.QParserPlugin
DEFAULT_QTYPE, standardPlugins
 
Constructor Summary
CollapsingQParserPlugin()
           
 
Method Summary
 QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest request)
          return a QParser
 void init(NamedList namedList)
           
 
Methods inherited from class org.apache.solr.search.QParserPlugin
getCategory, getDescription, getDocs, getName, getSource, getStatistics, getVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
See Also:
Constant Field Values

NULL_COLLAPSE

public static final String NULL_COLLAPSE
See Also:
Constant Field Values

NULL_IGNORE

public static final String NULL_IGNORE
See Also:
Constant Field Values

NULL_EXPAND

public static final String NULL_EXPAND
See Also:
Constant Field Values
Constructor Detail

CollapsingQParserPlugin

public CollapsingQParserPlugin()
Method Detail

init

public void init(NamedList namedList)

createParser

public QParser createParser(String qstr,
                            SolrParams localParams,
                            SolrParams params,
                            SolrQueryRequest request)
Description copied from class: QParserPlugin
return a QParser

Specified by:
createParser in class QParserPlugin


Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.