Package org.apache.solr.search
Class DisMaxQParserPlugin
- java.lang.Object
-
- org.apache.solr.search.QParserPlugin
-
- org.apache.solr.search.DisMaxQParserPlugin
-
- All Implemented Interfaces:
AutoCloseable
,SolrInfoBean
,SolrMetricProducer
,NamedListInitializedPlugin
public class DisMaxQParserPlugin extends QParserPlugin
Create a dismax query from the input value.
localParams are checked before global request params.
Example:{!dismax qf='myfield mytitle^2'}foo
creates a dismax query across across myfield and mytitle, with a higher weight on mytitle.A Generic query plugin designed to be given a simple query expression from a user, which it will then query against a variety of pre-configured fields, in a variety of ways, using BooleanQueries, DisjunctionMaxQueries, and PhraseQueries.
All of the following options may be configured for this plugin in the solrconfig as defaults, and may be overridden as request parameters
- q.alt - An alternate query to be used in cases where the main query (q) is not specified
(or blank). This query should be expressed in the Standard SolrQueryParser syntax (you can
use
q.alt=*:*
to denote that all documents should be returned when no query is specified) - tie - (Tie breaker) float value to use as tiebreaker in DisjunctionMaxQueries (should be something much less than 1)
- qf - (Query Fields) fields and boosts to use when building DisjunctionMaxQueries from the
users query. Format is: "
fieldA^1.0 fieldB^2.2
". This param can be specified multiple times, and the fields are additive. - mm - (Minimum Match) this supports a wide variety of complex expressions. read
SolrPluginUtils.setMinShouldMatch
and mm expression format for details. - pf - (Phrase Fields) fields/boosts to make phrase queries out of, to boost the users query
for exact matches on the specified fields. Format is: "
fieldA^1.0 fieldB^2.2
". This param can be specified multiple times, and the fields are additive. - ps - (Phrase Slop) amount of slop on phrase queries built for pf fields.
- qs - (Query Slop) amount of slop on phrase queries explicitly specified in the "q" for qf fields.
- bq - (Boost Query) a raw lucene query that will be included in the users query to influence
the score. If this is a BooleanQuery with a default boost (1.0f), then the individual
clauses will be added directly to the main query. Otherwise, the query will be included as
is. This param can be specified multiple times, and the boosts are are additive. NOTE: the
behaviour listed above is only in effect if a single
bq
paramter is specified. Hence you can disable it by specifying an additional, blank,bq
parameter. - bf - (Boost Functions) functions (with optional boosts) that will be included in the users
query to influence the score. Format is: "
funcA(arg1,arg2)^1.2 funcB(arg3,arg4)^2.2
". NOTE: Whitespace is not allowed in the function arguments. This param can be specified multiple times, and the functions are additive. - fq - (Filter Query) a raw lucene query that can be used to restrict the super set of products we are interested in - more efficient then using bq, but doesn't influence score. This param can be specified multiple times, and the filters are additive.
The following options are only available as request params...
- q - (Query) the raw unparsed, unescaped, query from the user.
- sort - (Order By) list of fields and direction to sort on.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.solr.core.SolrInfoBean
SolrInfoBean.Category, SolrInfoBean.Group
-
-
Field Summary
Fields Modifier and Type Field Description static String
NAME
-
Fields inherited from class org.apache.solr.search.QParserPlugin
DEFAULT_QTYPE, standardPlugins
-
-
Constructor Summary
Constructors Constructor Description DisMaxQParserPlugin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QParser
createParser(String qstr, org.apache.solr.common.params.SolrParams localParams, org.apache.solr.common.params.SolrParams params, SolrQueryRequest req)
return aQParser
-
Methods inherited from class org.apache.solr.search.QParserPlugin
getCategory, getDescription, getName, getSolrMetricsContext, initializeMetrics
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.solr.util.plugin.NamedListInitializedPlugin
init
-
Methods inherited from interface org.apache.solr.metrics.SolrMetricProducer
close
-
-
-
-
Field Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
createParser
public QParser createParser(String qstr, org.apache.solr.common.params.SolrParams localParams, org.apache.solr.common.params.SolrParams params, SolrQueryRequest req)
Description copied from class:QParserPlugin
return aQParser
- Specified by:
createParser
in classQParserPlugin
-
-