Class QueryNodeProcessorImpl
java.lang.Object
org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorImpl
- All Implemented Interfaces:
QueryNodeProcessor
- Direct Known Subclasses:
AllowLeadingWildcardProcessor,AnalyzerQueryNodeProcessor,BooleanModifiersQueryNodeProcessor,BooleanSingleChildOptimizationQueryNodeProcessor,BoostQueryNodeProcessor,DefaultPhraseSlopQueryNodeProcessor,FuzzyQueryNodeProcessor,LowercaseExpandedTermsQueryNodeProcessor,MatchAllDocsQueryNodeProcessor,MultiFieldQueryNodeProcessor,MultiTermRewriteMethodProcessor,NoChildOptimizationQueryNodeProcessor,NumericQueryNodeProcessor,NumericRangeQueryNodeProcessor,OpenRangeQueryNodeProcessor,PhraseSlopQueryNodeProcessor,RemoveDeletedQueryNodesProcessor,RemoveEmptyNonLeafQueryNodeProcessor,TermRangeQueryNodeProcessor,WildcardQueryNodeProcessor
This is a default implementation for the QueryNodeProcessor
interface, it's an abstract class, so it should be extended by classes that
want to process a QueryNode tree.
This class process QueryNodes from left to right in the tree. While
it's walking down the tree, for every node,
preProcessNode(QueryNode) is invoked. After a node's children are
processed, postProcessNode(QueryNode) is invoked for that node.
setChildrenOrder(List) is invoked before
postProcessNode(QueryNode) only if the node has at least one child,
in setChildrenOrder(List) the implementor might redefine the
children order or remove any children from the children list.
Here is an example about how it process the nodes:
a
/ \
b e
/ \
c d
Here is the order the methods would be invoked for the tree described above:
preProcessNode( a );
preProcessNode( b );
preProcessNode( c );
postProcessNode( c );
preProcessNode( d );
postProcessNode( d );
setChildrenOrder( bChildrenList );
postProcessNode( b );
preProcessNode( e );
postProcessNode( e );
setChildrenOrder( aChildrenList );
postProcessNode( a )
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFor reference about this method check:QueryNodeProcessor.getQueryConfigHandler().Processes a query node tree.voidsetQueryConfigHandler(QueryConfigHandler queryConfigHandler) For reference about this method check:QueryNodeProcessor.setQueryConfigHandler(QueryConfigHandler).
-
Constructor Details
-
QueryNodeProcessorImpl
public QueryNodeProcessorImpl() -
QueryNodeProcessorImpl
-
-
Method Details
-
process
Description copied from interface:QueryNodeProcessorProcesses a query node tree. It may return the same or another query tree. I should never returnnull.- Specified by:
processin interfaceQueryNodeProcessor- Parameters:
queryTree- tree root node- Returns:
- the processed query tree
- Throws:
QueryNodeException
-
setQueryConfigHandler
For reference about this method check:QueryNodeProcessor.setQueryConfigHandler(QueryConfigHandler).- Specified by:
setQueryConfigHandlerin interfaceQueryNodeProcessor- Parameters:
queryConfigHandler- the query configuration handler to be set.- See Also:
-
getQueryConfigHandler
For reference about this method check:QueryNodeProcessor.getQueryConfigHandler().- Specified by:
getQueryConfigHandlerin interfaceQueryNodeProcessor- Returns:
- QueryConfigHandler the query configuration handler to be set.
- See Also:
-