Class ParserExtension
java.lang.Object
org.apache.lucene.queryparser.ext.ParserExtension
This class represents an extension base class to the Lucene standard
QueryParser. The QueryParser is generated by the JavaCC parser generator.
Changing or adding functionality or syntax in the standard query parser requires changes to the
JavaCC source file. To enable extending the standard query parser without changing the JavaCC
sources and re-generate the parser the ParserExtension can be customized and plugged into
an instance of ExtendableQueryParser, a direct subclass of QueryParser.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Queryparse(ExtensionQuery query) Processes the givenExtensionQueryand returns a correspondingQueryinstance.
-
Constructor Details
-
ParserExtension
public ParserExtension()
-
-
Method Details
-
parse
Processes the givenExtensionQueryand returns a correspondingQueryinstance. Subclasses must either return aQueryinstance or raise aParseException. This method must not returnnull.- Parameters:
query- the extension query- Returns:
- a new query instance
- Throws:
ParseException- if the query can not be parsed.
-