Package org.apache.solr.search
Class SimpleQParserPlugin
- java.lang.Object
-
- org.apache.solr.search.QParserPlugin
-
- org.apache.solr.search.SimpleQParserPlugin
-
- All Implemented Interfaces:
AutoCloseable
,SolrInfoBean
,SolrMetricProducer
,NamedListInitializedPlugin
public class SimpleQParserPlugin extends QParserPlugin
Create a query from the input value that will be parsed by Lucene's SimpleQueryParser. SeeSimpleQueryParser
for details on the exact syntax allowed to be used for queries.
The following options may be applied for parsing the query.- q.operators - Used to enable specific operations for parsing. The operations that can be enabled are and, not, or, prefix, phrase, precedence, escape, and whitespace. By default all operations are enabled. All operations can be disabled by passing in an empty string to this parameter.
- q.op - Used to specify the operator to be used if whitespace is a delimiter. Either 'AND' or 'OR' can be specified for this parameter. Any other string will cause an exception to be thrown. If this parameter is not specified 'OR' will be used by default.
- qf - The list of query fields and boosts to use when building the simple query. The format
is the following:
fieldA^1.0 fieldB^2.2
. A field can also be specified without a boost by simply listing the field asfieldA fieldB
. Any field without a boost will default to use a boost of 1.0. - df - An override for the default field specified in the schema or a default field if one is not specified in the schema. If qf is not specified the default field will be used as the field to run the query against.
-
-
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
The name that can be used to specify this plugin should be used to parse the query.-
Fields inherited from class org.apache.solr.search.QParserPlugin
DEFAULT_QTYPE, standardPlugins
-
-
Constructor Summary
Constructors Constructor Description SimpleQParserPlugin()
-
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)
Returns a QParser that will create a query by using Lucene's SimpleQueryParser.-
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
The name that can be used to specify this plugin should be used to parse the query.- 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)
Returns a QParser that will create a query by using Lucene's SimpleQueryParser.- Specified by:
createParser
in classQParserPlugin
-
-