Class BooleanModifiersQueryNodeProcessor
This processor is used to apply the correct ModifierQueryNode to BooleanQueryNodes children.
It 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 MOD_NONE, becomes a MOD_REQ. For any other BooleanQueryNode which is not an OrQueryNode, it checks the default operator is AND, if it is, the same operation when an AndQueryNode is found is applied to it.
Implements
Inherited Members
Namespace: Lucene.Net.QueryParsers.Flexible.Precedence.Processors
Assembly: Lucene.Net.QueryParser.dll
Syntax
public class BooleanModifiersQueryNodeProcessor : QueryNodeProcessor, IQueryNodeProcessor
Constructors
BooleanModifiersQueryNodeProcessor()
This processor is used to apply the correct ModifierQueryNode to BooleanQueryNodes children.
It 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 MOD_NONE, becomes a MOD_REQ. For any other BooleanQueryNode which is not an OrQueryNode, it checks the default operator is AND, if it is, the same operation when an AndQueryNode is found is applied to it.
Declaration
public BooleanModifiersQueryNodeProcessor()
See Also
Methods
PostProcessNode(IQueryNode)
This method is invoked for every node when walking up the tree.
Declaration
protected override IQueryNode PostProcessNode(IQueryNode node)
Parameters
Type | Name | Description |
---|---|---|
IQueryNode | node | node the query node to be post-processed |
Returns
Type | Description |
---|---|
IQueryNode | a query node |
Overrides
Exceptions
Type | Condition |
---|---|
QueryNodeException | if something goes wrong during the query node processing |
See Also
PreProcessNode(IQueryNode)
This method is invoked for every node when walking down the tree.
Declaration
protected override IQueryNode PreProcessNode(IQueryNode node)
Parameters
Type | Name | Description |
---|---|---|
IQueryNode | node | the query node to be pre-processed |
Returns
Type | Description |
---|---|
IQueryNode | a query node |
Overrides
Exceptions
Type | Condition |
---|---|
QueryNodeException | if something goes wrong during the query node processing |
See Also
Process(IQueryNode)
Processes a query node tree. It may return the same or another query tree.
I should never return null
.
Declaration
public override IQueryNode Process(IQueryNode queryTree)
Parameters
Type | Name | Description |
---|---|---|
IQueryNode | queryTree | tree root node |
Returns
Type | Description |
---|---|
IQueryNode | the processed query tree |
Overrides
See Also
SetChildrenOrder(IList<IQueryNode>)
This method is invoked for every node that has at least on child. It's invoked right before PostProcessNode(IQueryNode) is invoked.
Declaration
protected override IList<IQueryNode> SetChildrenOrder(IList<IQueryNode> children)
Parameters
Type | Name | Description |
---|---|---|
IList<IQueryNode> | children | the list containing all current node's children |
Returns
Type | Description |
---|---|
IList<IQueryNode> | a new list containing all children that should be set to the current node |
Overrides
Exceptions
Type | Condition |
---|---|
QueryNodeException | if something goes wrong during the query node processing |