org.apache.solr.parser

## Class QueryParser

- java.lang.Object
- - org.apache.lucene.util.QueryBuilder
  - - org.apache.solr.parser.SolrQueryParserBase
    - - org.apache.solr.parser.QueryParser

- All Implemented Interfaces:
    QueryParserConstants
  Direct Known Subclasses:
    SolrQueryParser

      public class QueryParser
      extends SolrQueryParserBase
      implements QueryParserConstants

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `QueryParser.Operator` The default operator for parsing queries.

    - ### Nested classes/interfaces inherited from class org.apache.solr.parser.SolrQueryParserBase

      `SolrQueryParserBase.MagicFieldName`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `Token` | `jj_nt` Next token.
    `Token` | `token` Current token.
    `QueryParserTokenManager` | `token_source` Generated Token Manager.

    - ### Fields inherited from class org.apache.solr.parser.SolrQueryParserBase

      `AND_OPERATOR, explicitField, OR_OPERATOR, parser, schema`

    - ### Fields inherited from interface org.apache.solr.parser.QueryParserConstants

      `_ESCAPED_CHAR, _NUM_CHAR, _QUOTED_CHAR, _SQUOTED_CHAR, _TERM_CHAR, _TERM_START_CHAR, _WHITESPACE, AND, BAREOPER, Boost, CARAT, COLON, COMMENT, DEFAULT, EOF, FILTER, FUZZY_SLOP, LPARAMS, LPAREN, MINUS, NOT, NUMBER, OR, PLUS, PREFIXTERM, QUOTED, Range, RANGE_GOOP, RANGE_QUOTED, RANGE_TO, RANGEEX_END, RANGEEX_START, RANGEIN_END, RANGEIN_START, REGEXPTERM, RPAREN, STAR, TERM, tokenImage, WILDTERM`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `QueryParser(CharStream stream)` Constructor with user supplied CharStream.
    `protected` | `QueryParser(QueryParserTokenManager tm)` Constructor with generated Token Manager.
    `` | `QueryParser(Version matchVersion, String defaultField, QParser parser)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Query` | `Clause(String field)`
    `int` | `Conjunction()`
    `void` | `disable_tracing()` Disable tracing.
    `void` | `enable_tracing()` Enable tracing.
    `ParseException` | `generateParseException()` Generate ParseException.
    `Token` | `getNextToken()` Get the next Token.
    `Token` | `getToken(int index)` Get the specific Token.
    `int` | `Modifiers()`
    `Query` | `Query(String field)`
    `void` | `ReInit(CharStream stream)` Reinitialise.
    `void` | `ReInit(QueryParserTokenManager tm)` Reinitialise.
    `Query` | `Term(String field)`
    `Query` | `TopLevelQuery(String field)`

    - ### Methods inherited from class org.apache.solr.parser.SolrQueryParserBase

      `addClause, analyzeIfMultitermTermText, escape, getAllowLeadingWildcard, getAutoGeneratePhraseQueries, getBooleanQuery, getDefaultField, getDefaultOperator, getExplicitField, getField, getFieldQuery, getFieldQuery, getFuzzyMinSim, getFuzzyPrefixLength, getFuzzyQuery, getLocalParams, getMultiTermRewriteMethod, getPhraseSlop, getPrefixQuery, getRangeQuery, getRegexpQuery, getReversedWildcardFilterFactory, getWildcardQuery, init, newBooleanClause, newFieldQuery, newFuzzyQuery, newMatchAllDocsQuery, newPrefixQuery, newRegexpQuery, newWildcardQuery, parse, setAllowLeadingWildcard, setAutoGeneratePhraseQueries, setDefaultOperator, setFuzzyMinSim, setFuzzyPrefixLength, setMultiTermRewriteMethod, setPhraseSlop`

    - ### Methods inherited from class org.apache.lucene.util.QueryBuilder

      `createBooleanQuery, createBooleanQuery, createFieldQuery, createMinShouldMatchQuery, createPhraseQuery, createPhraseQuery, getAnalyzer, getEnablePositionIncrements, newBooleanQuery, newMultiPhraseQueryBuilder, newSynonymQuery, newTermQuery, setAnalyzer, setEnablePositionIncrements`

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

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

- - ### Field Detail

    - #### token_source

          public QueryParserTokenManager token_source

      Generated Token Manager.

    - #### token

          public Token token

      Current token.

    - #### jj_nt

          public Token jj_nt

      Next token.

  - ### Constructor Detail

    - #### QueryParser

          public QueryParser(Version matchVersion,
                             String defaultField,
                             QParser parser)

    - #### QueryParser

          protected QueryParser(CharStream stream)

      Constructor with user supplied CharStream.

    - #### QueryParser

          protected QueryParser(QueryParserTokenManager tm)

      Constructor with generated Token Manager.

  - ### Method Detail

    - #### Conjunction

          public final int Conjunction()
                                throws ParseException

      Throws:
        `ParseException`

    - #### Modifiers

          public final int Modifiers()
                              throws ParseException

      Throws:
        `ParseException`

    - #### TopLevelQuery

          public final Query TopLevelQuery(String field)
                                    throws ParseException,
                                           SyntaxError

      Specified by:
        `TopLevelQuery` in class `SolrQueryParserBase`
      Throws:
        `ParseException`
        `SyntaxError`

    - #### Query

          public final Query Query(String field)
                            throws ParseException,
                                   SyntaxError

      Throws:
        `ParseException`
        `SyntaxError`

    - #### Clause

          public final Query Clause(String field)
                             throws ParseException,
                                    SyntaxError

      Throws:
        `ParseException`
        `SyntaxError`

    - #### Term

          public final Query Term(String field)
                           throws ParseException,
                                  SyntaxError

      Throws:
        `ParseException`
        `SyntaxError`

    - #### ReInit

          public void ReInit(CharStream stream)

      Reinitialise.
      Specified by:
        `ReInit` in class `SolrQueryParserBase`

    - #### ReInit

          public void ReInit(QueryParserTokenManager tm)

      Reinitialise.

    - #### getNextToken

          public final Token getNextToken()

      Get the next Token.

    - #### getToken

          public final Token getToken(int index)

      Get the specific Token.

    - #### generateParseException

          public ParseException generateParseException()

      Generate ParseException.

    - #### enable_tracing

          public final void enable_tracing()

      Enable tracing.

    - #### disable_tracing

          public final void disable_tracing()

      Disable tracing.

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.