Class RemoveEmptyNonLeafQueryNodeProcessor
- java.lang.Object
-
- org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorImpl
-
- org.apache.lucene.queryparser.flexible.standard.processors.RemoveEmptyNonLeafQueryNodeProcessor
-
- All Implemented Interfaces:
QueryNodeProcessor
public class RemoveEmptyNonLeafQueryNodeProcessor extends QueryNodeProcessorImpl
This processor removes everyQueryNodethat is not a leaf and has not children. If after processing the entire tree the root node is not a leaf and has no children, aMatchNoDocsQueryNodeobject is returned.
This processor is used at the end of a pipeline to avoid invalid query node tree structures like aGroupQueryNodeorModifierQueryNodewith no children.- See Also:
QueryNode,MatchNoDocsQueryNode
-
-
Constructor Summary
Constructors Constructor Description RemoveEmptyNonLeafQueryNodeProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QueryNodeprocess(QueryNode queryTree)Processes a query node tree.-
Methods inherited from class org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorImpl
getQueryConfigHandler, setQueryConfigHandler
-
-
-
-
Method Detail
-
process
public QueryNode process(QueryNode queryTree) throws QueryNodeException
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- Overrides:
processin classQueryNodeProcessorImpl- Parameters:
queryTree- tree root node- Returns:
- the processed query tree
- Throws:
QueryNodeException
-
-