Class StandardSyntaxParser
java.lang.Object
org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser
- All Implemented Interfaces:
SyntaxParser,StandardSyntaxParserConstants
public class StandardSyntaxParser
extends Object
implements SyntaxParser, StandardSyntaxParserConstants
Parser for the standard Lucene syntax
-
Field Summary
FieldsModifier and TypeFieldDescriptionNext token.Current token.Generated Token Manager.Fields inherited from interface org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParserConstants
_ESCAPED_CHAR, _NUM_CHAR, _QUOTED_CHAR, _TERM_CHAR, _TERM_START_CHAR, _WHITESPACE, AND, Boost, CARAT, DEFAULT, EOF, FUZZY_SLOP, LPAREN, MINUS, NOT, NUMBER, OP_COLON, OP_EQUAL, OP_LESSTHAN, OP_LESSTHANEQ, OP_MORETHAN, OP_MORETHANEQ, OR, PLUS, QUOTED, Range, RANGE_GOOP, RANGE_QUOTED, RANGE_TO, RANGEEX_END, RANGEEX_START, RANGEIN_END, RANGEIN_START, REGEXPTERM, RPAREN, TERM, tokenImage -
Constructor Summary
ConstructorsConstructorDescriptionStandardSyntaxParser(CharStream stream) Constructor with user supplied CharStream.Constructor with generated Token Manager. -
Method Summary
Modifier and TypeMethodDescriptionfinal QueryNodeClause(CharSequence field) final QueryNodeConjQuery(CharSequence field) final intfinal voidDisable tracing.final QueryNodeDisjQuery(CharSequence field) final voidEnable tracing.Generate ParseException.final TokenGet the next Token.final TokengetToken(int index) Get the specific Token.final QueryNodeModClause(CharSequence field) parse(CharSequence query, CharSequence field) Parses a query string, returning aQueryNode.final QueryNodeQuery(CharSequence field) voidReInit(CharStream stream) Reinitialise.voidReinitialise.final QueryNodeTerm(CharSequence field) final QueryNodeTopLevelQuery(CharSequence field)
-
Field Details
-
token_source
Generated Token Manager. -
token
Current token. -
jj_nt
Next token.
-
-
Constructor Details
-
StandardSyntaxParser
public StandardSyntaxParser() -
StandardSyntaxParser
Constructor with user supplied CharStream. -
StandardSyntaxParser
Constructor with generated Token Manager.
-
-
Method Details
-
parse
Parses a query string, returning aQueryNode.- Specified by:
parsein interfaceSyntaxParser- Parameters:
query- the query string to be parsed.field- - default field name- Returns:
- QueryNode tree
- Throws:
ParseException- if the parsing failsQueryNodeParseException
-
Conjunction
- Throws:
ParseException
-
Modifiers
- Throws:
ParseException
-
TopLevelQuery
- Throws:
ParseException
-
Query
- Throws:
ParseException
-
DisjQuery
- Throws:
ParseException
-
ConjQuery
- Throws:
ParseException
-
ModClause
- Throws:
ParseException
-
Clause
- Throws:
ParseException
-
Term
- Throws:
ParseException
-
ReInit
Reinitialise. -
ReInit
Reinitialise. -
getNextToken
Get the next Token. -
getToken
Get the specific Token. -
generateParseException
Generate ParseException. -
enable_tracing
public final void enable_tracing()Enable tracing. -
disable_tracing
public final void disable_tracing()Disable tracing.
-