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.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 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.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.solr.core.SolrInfoMBean

      `SolrInfoMBean.Category`

  - ### Field Summary

    Fields
    Modifier and Type | Field and 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 and Description
    `SimpleQParserPlugin()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `QParser` | `createParser(String qstr, SolrParams localParams, 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, getDocs, getName, getSource, getStatistics, getVersion, init`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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

  - ### Constructor Detail

    - #### SimpleQParserPlugin

          public SimpleQParserPlugin()

  - ### Method Detail

    - #### 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-2016 Apache Software Foundation. All Rights Reserved.