public class CollapsingQParserPlugin extends QParserPlugin
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
Modifier and Type | Class and Description |
---|---|
static class |
CollapsingQParserPlugin.CollapseScore |
static class |
CollapsingQParserPlugin.CollapsingPostFilter |
static class |
CollapsingQParserPlugin.GroupHeadSelector
Models all the information about how group head documents should be selected
|
static class |
CollapsingQParserPlugin.GroupHeadSelectorType |
SolrInfoBean.Category, SolrInfoBean.Group
Modifier and Type | Field and Description |
---|---|
static String |
HINT_MULTI_DOCVALUES |
static String |
HINT_TOP_FC |
static String |
NAME |
static String |
NULL_COLLAPSE |
static String |
NULL_EXPAND |
static String |
NULL_IGNORE |
DEFAULT_QTYPE, standardPlugins
Constructor and Description |
---|
CollapsingQParserPlugin() |
Modifier and Type | Method and Description |
---|---|
QParser |
createParser(String qstr,
SolrParams localParams,
SolrParams params,
SolrQueryRequest request)
return a
QParser |
static LeafReader |
getTopFieldCacheReader(SolrIndexSearcher searcher,
String collapseField)
This forces the use of the top level field cache for String fields.
|
static Sort |
rewriteSort(SortSpec sortSpec,
IndexSearcher searcher)
Helper method for rewriting the Sort associated with a SortSpec.
|
getCategory, getDescription, getMetricNames, getName, init
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMetricRegistry, getMetricsSnapshot, registerMetricName
public static final String NAME
public static final String NULL_COLLAPSE
public static final String NULL_IGNORE
public static final String NULL_EXPAND
public static final String HINT_TOP_FC
public static final String HINT_MULTI_DOCVALUES
public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest request)
QParserPlugin
QParser
createParser
in class QParserPlugin
public static LeafReader getTopFieldCacheReader(SolrIndexSearcher searcher, String collapseField)
public static Sort rewriteSort(SortSpec sortSpec, IndexSearcher searcher) throws IOException
IOException
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.