public class BooleanQuery2ModifierNodeProcessor extends Object implements QueryNodeProcessor
This processor is used to apply the correct ModifierQueryNode to
BooleanQueryNodes children. This is a variant of
BooleanModifiersQueryNodeProcessor which ignores precedence.
The StandardSyntaxParser knows the rules of precedence, but lucene
does not. e.g. (A AND B OR C AND D) ist treated like
(+A +B +C +D).
This processor walks through the query node tree looking for
BooleanQueryNodes. If an AndQueryNode is found, every child,
which is not a ModifierQueryNode or the ModifierQueryNode is
ModifierQueryNode.Modifier.MOD_NONE, becomes a ModifierQueryNode.Modifier.MOD_REQ. For default
BooleanQueryNode, it checks the default operator is
StandardQueryConfigHandler.Operator.AND, if it is, the same operation when an
AndQueryNode is found is applied to it. Each BooleanQueryNode
which direct parent is also a BooleanQueryNode is removed (to ignore
the rules of precedence).
| Constructor and Description |
|---|
BooleanQuery2ModifierNodeProcessor() |
| Modifier and Type | Method and Description |
|---|---|
QueryConfigHandler |
getQueryConfigHandler()
Returns the
QueryConfigHandler associated to the query tree if any,
otherwise it returns null |
QueryNode |
process(QueryNode queryTree)
Processes a query node tree.
|
void |
setQueryConfigHandler(QueryConfigHandler queryConfigHandler)
Sets the
QueryConfigHandler associated to the query tree. |
public QueryNode process(QueryNode queryTree) throws QueryNodeException
QueryNodeProcessornull.process in interface QueryNodeProcessorqueryTree - tree root nodeQueryNodeExceptionpublic void setQueryConfigHandler(QueryConfigHandler queryConfigHandler)
QueryNodeProcessorQueryConfigHandler associated to the query tree.setQueryConfigHandler in interface QueryNodeProcessorpublic QueryConfigHandler getQueryConfigHandler()
QueryNodeProcessorQueryConfigHandler associated to the query tree if any,
otherwise it returns nullgetQueryConfigHandler in interface QueryNodeProcessorQueryConfigHandler associated to the query tree if any,
otherwise it returns nullCopyright © 2010 - 2020 Adobe. All Rights Reserved