org.apache.solr.search
Class SimpleQParserPlugin
java.lang.Object
org.apache.solr.search.QParserPlugin
org.apache.solr.search.SimpleQParserPlugin
- All Implemented Interfaces:
- SolrInfoMBean, NamedListInitializedPlugin
public class SimpleQParserPlugin
- extends QParserPlugin
Create a query from the input value that will be parsed by Lucene's SimpleQueryParser.
See SimpleQueryParser
for details on the exact syntax allowed
to be used for queries.
The following options may be applied for parsing the query.
-
q.operations - 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 as fieldA 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 |
static String |
NAME
The name that can be used to specify this plugin should be used to parse the query. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
SimpleQParserPlugin
public SimpleQParserPlugin()
init
public void init(NamedList args)
- No initialization is necessary so this method is empty.
createParser
public QParser createParser(String qstr,
SolrParams localParams,
SolrParams params,
SolrQueryRequest req)
- Returns a QParser that will create a query by using Lucene's SimpleQueryParser.
- Specified by:
createParser
in class QParserPlugin
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.