Class QueryNodeProcessor
This is a default implementation for the IQueryNodeProcessor interface, it's an abstract class, so it should be extended by classes that want to process a IQueryNode tree.
This class process IQueryNodes from left to right in the tree. While it's walking down the tree, for every node, PreProcessNode(IQueryNode) is invoked. After a node's children are processed, PostProcessNode(IQueryNode) is invoked for that node. SetChildrenOrder(IList<IQueryNode>) is invoked before PostProcessNode(IQueryNode) only if the node has at least one child, in SetChildrenOrder(IList<IQueryNode>) 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 )
Inheritance
Implements
Inherited Members
Namespace: Lucene.Net.QueryParsers.Flexible.Core.Processors
Assembly: Lucene.Net.QueryParser.dll
Syntax
public abstract class QueryNodeProcessor : IQueryNodeProcessor
Constructors
| Improve this Doc View SourceQueryNodeProcessor()
Declaration
public QueryNodeProcessor()
QueryNodeProcessor(QueryConfigHandler)
Declaration
public QueryNodeProcessor(QueryConfigHandler queryConfigHandler)
Parameters
Type | Name | Description |
---|---|---|
QueryConfigHandler | queryConfigHandler |
Methods
| Improve this Doc View SourceGetQueryConfigHandler()
For reference about this method check: GetQueryConfigHandler().
Declaration
public virtual QueryConfigHandler GetQueryConfigHandler()
Returns
Type | Description |
---|---|
QueryConfigHandler | QueryConfigHandler the query configuration handler to be set. |
See Also
| Improve this Doc View SourcePostProcessNode(IQueryNode)
This method is invoked for every node when walking up the tree.
Declaration
protected abstract 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 |
Exceptions
Type | Condition |
---|---|
QueryNodeException | if something goes wrong during the query node processing |
PreProcessNode(IQueryNode)
This method is invoked for every node when walking down the tree.
Declaration
protected abstract IQueryNode PreProcessNode(IQueryNode node)
Parameters
Type | Name | Description |
---|---|---|
IQueryNode | node | the query node to be pre-processed |
Returns
Type | Description |
---|---|
IQueryNode | a query node |
Exceptions
Type | Condition |
---|---|
QueryNodeException | if something goes wrong during the query node processing |
Process(IQueryNode)
Declaration
public virtual IQueryNode Process(IQueryNode queryTree)
Parameters
Type | Name | Description |
---|---|---|
IQueryNode | queryTree |
Returns
Type | Description |
---|---|
IQueryNode |
ProcessChildren(IQueryNode)
This method is called every time a child is processed.
Declaration
protected virtual void ProcessChildren(IQueryNode queryTree)
Parameters
Type | Name | Description |
---|---|---|
IQueryNode | queryTree | the query node child to be processed |
Exceptions
Type | Condition |
---|---|
QueryNodeException | if something goes wrong during the query node processing |
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 abstract IList<IQueryNode> SetChildrenOrder(IList<IQueryNode> children)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<IQueryNode> | children | the list containing all current node's children |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<IQueryNode> | a new list containing all children that should be set to the current node |
Exceptions
Type | Condition |
---|---|
QueryNodeException | if something goes wrong during the query node processing |
SetQueryConfigHandler(QueryConfigHandler)
For reference about this method check: SetQueryConfigHandler(QueryConfigHandler).
Declaration
public virtual void SetQueryConfigHandler(QueryConfigHandler queryConfigHandler)
Parameters
Type | Name | Description |
---|---|---|
QueryConfigHandler | queryConfigHandler | the query configuration handler to be set. |