org.apache.lucene.queryParser.core.builders | Contains the necessary classes to implement query builders Query Parser Builders The package org.apache.lucene.queryParser.builders contains the interface that builders must implement, it also contain a utility org.apache.lucene.queryParser.core.builders.QueryTreeBuilder , which walks the tree and call the Builder for each node in the tree. |
org.apache.lucene.queryParser.core.config | Contains the base classes used to configure the query processing Query Configuration Interfaces The package org.apache.lucene.queryParser.config contains query configuration handler abstract class that all config handlers should extend. |
org.apache.lucene.queryParser.core.messages | Contains messages usually used by query parser implementations Query Parser Messages Messages for the Flexible Query Parser, they use org.apache.lucene.messages.NLS API. |
org.apache.lucene.queryParser.core.nodes | Contains query nodes that are commonly used by query parser implementations Query Nodes The package org.apache.lucene.queryParser.nodes contains all the basic query nodes. |
org.apache.lucene.queryParser.core.parser | Contains the necessary interfaces to implement text parsers Parser The package org.apache.lucene.queryParser.parser contains interfaces that should be implemented by the parsers. |
org.apache.lucene.queryParser.core.processors | Interfaces and implementations used by query node processors Query Node Processors The package org.apache.lucene.queryParser.processors contains interfaces that should be implemented by every query node processor. |
org.apache.lucene.queryParser.core.util | Utility classes to used with the Query Parser Utility classes to used with the Query Parser This package contains utility classes used with the query parsers. |
QueryNodeError | Error class with NLS support | code | html |
QueryNodeException | This exception should be thrown if something wrong happens when dealing with QueryNode s. |
code | html |
QueryNodeParseException | This should be thrown when an exception happens during the query parsing from string to the query node tree. | code | html |
QueryParserHelper | This class is a helper for the query parser framework, it does all the three query parser phrases at once: text parsing, query processing and query building. |
code | html |
This package contains the necessary classes to implement a query parser.
A query parser is divided in at least 2 phases, text parsing and query building, and one optional phase called query processing.
The text parsing phase is performed by a text parser, which implements org.apache.lucene.queryParser.core.parser.SyntaxParser interface. A text parser is responsible to get a query string and convert it to a org.apache.lucene.queryParser.core.nodes.QueryNode tree, which is an object structure that represents the elements defined in the query string.
The query processing phase is performed by a query processor, which implements org.apache.lucene.queryParser.core.processors.QueryNodeProcessor . A query processor is responsible to perform any processing on a org.apache.lucene.queryParser.core.nodes.QueryNode tree. This phase is optional and is used only if an extra processing, validation, query expansion, etc needs to be performed in a org.apache.lucene.queryParser.core.nodes.QueryNode tree. The org.apache.lucene.queryParser.core.nodes.QueryNode tree can be either be generated by a text parser or programmatically created.
The query building phase is performed by a query builder, which implements org.apache.lucene.queryParser.core.builders.QueryBuilder . A query builder is responsible to convert a org.apache.lucene.queryParser.core.nodes.QueryNode tree into an arbitrary object, which is usually used to be executed against a search index.