Package org.apache.solr.search
Class SimpleQParserPlugin
java.lang.Object
org.apache.solr.search.QParserPlugin
org.apache.solr.search.SimpleQParserPlugin
- All Implemented Interfaces:
NamedListInitializedPlugin
Create a query from the input value that will be parsed by Lucene's SimpleQueryParser. See
The following options may be applied for parsing the query.
SimpleQueryParser 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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe 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 -
Method Summary
Modifier and TypeMethodDescriptioncreateParser(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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.solr.util.plugin.NamedListInitializedPlugin
init
-
Field Details
-
NAME
The name that can be used to specify this plugin should be used to parse the query.- See Also:
-
-
Constructor Details
-
SimpleQParserPlugin
public SimpleQParserPlugin()
-
-
Method Details
-
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:
createParserin classQParserPlugin- See Also:
-