|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.queryparser.flexible.standard.processors.BooleanQuery2ModifierNodeProcessor
public class BooleanQuery2ModifierNodeProcessor
This processor is used to apply the correct ModifierQueryNode
to
BooleanQueryNode
s 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
BooleanQueryNode
s. 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).
StandardQueryConfigHandler.ConfigurationKeys.DEFAULT_OPERATOR
,
BooleanModifiersQueryNodeProcessor
Constructor Summary | |
---|---|
BooleanQuery2ModifierNodeProcessor()
|
Method Summary | |
---|---|
protected void |
fillChildrenBufferAndApplyModifiery(QueryNode parent)
|
QueryConfigHandler |
getQueryConfigHandler()
Returns the QueryConfigHandler associated to the query tree if any,
otherwise it returns null |
protected boolean |
isDefaultBooleanQueryNode(QueryNode toTest)
|
protected QueryNode |
postProcessNode(QueryNode node)
|
protected QueryNode |
preProcessNode(QueryNode node)
|
QueryNode |
process(QueryNode queryTree)
Processes a query node tree. |
protected void |
processChildren(QueryNode queryTree)
|
void |
setQueryConfigHandler(QueryConfigHandler queryConfigHandler)
Sets the QueryConfigHandler associated to the query tree. |
protected void |
tagModifierButDoNotOverride(QueryNode node,
ModifierQueryNode.Modifier mod)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BooleanQuery2ModifierNodeProcessor()
Method Detail |
---|
public QueryNode process(QueryNode queryTree) throws QueryNodeException
QueryNodeProcessor
null
.
process
in interface QueryNodeProcessor
queryTree
- tree root node
QueryNodeException
protected void processChildren(QueryNode queryTree) throws QueryNodeException
QueryNodeException
protected void fillChildrenBufferAndApplyModifiery(QueryNode parent)
protected QueryNode postProcessNode(QueryNode node) throws QueryNodeException
QueryNodeException
protected QueryNode preProcessNode(QueryNode node) throws QueryNodeException
QueryNodeException
protected boolean isDefaultBooleanQueryNode(QueryNode toTest)
protected void tagModifierButDoNotOverride(QueryNode node, ModifierQueryNode.Modifier mod)
public void setQueryConfigHandler(QueryConfigHandler queryConfigHandler)
QueryNodeProcessor
QueryConfigHandler
associated to the query tree.
setQueryConfigHandler
in interface QueryNodeProcessor
public QueryConfigHandler getQueryConfigHandler()
QueryNodeProcessor
QueryConfigHandler
associated to the query tree if any,
otherwise it returns null
getQueryConfigHandler
in interface QueryNodeProcessor
QueryConfigHandler
associated to the query tree if any,
otherwise it returns null
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |