Fork me on GitHub
  • API

    Show / Hide Table of Contents

    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
    object
    QueryNodeProcessor
    NoChildOptimizationQueryNodeProcessor
    RemoveDeletedQueryNodesProcessor
    BooleanModifiersQueryNodeProcessor
    AllowLeadingWildcardProcessor
    AnalyzerQueryNodeProcessor
    BooleanSingleChildOptimizationQueryNodeProcessor
    BoostQueryNodeProcessor
    DefaultPhraseSlopQueryNodeProcessor
    FuzzyQueryNodeProcessor
    LowercaseExpandedTermsQueryNodeProcessor
    MatchAllDocsQueryNodeProcessor
    MultiFieldQueryNodeProcessor
    MultiTermRewriteMethodProcessor
    NumericQueryNodeProcessor
    NumericRangeQueryNodeProcessor
    OpenRangeQueryNodeProcessor
    PhraseSlopQueryNodeProcessor
    RemoveEmptyNonLeafQueryNodeProcessor
    TermRangeQueryNodeProcessor
    WildcardQueryNodeProcessor
    Implements
    IQueryNodeProcessor
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.QueryParsers.Flexible.Core.Processors
    Assembly: Lucene.Net.QueryParser.dll
    Syntax
    public abstract class QueryNodeProcessor : IQueryNodeProcessor

    Constructors

    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 )
    Declaration
    protected QueryNodeProcessor()
    See Also
    IQueryNodeProcessor

    QueryNodeProcessor(QueryConfigHandler)

    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 )
    Declaration
    protected QueryNodeProcessor(QueryConfigHandler queryConfigHandler)
    Parameters
    Type Name Description
    QueryConfigHandler queryConfigHandler
    See Also
    IQueryNodeProcessor

    Methods

    GetQueryConfigHandler()

    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
    SetQueryConfigHandler(QueryConfigHandler)
    QueryConfigHandler

    PostProcessNode(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

    See Also
    IQueryNodeProcessor

    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

    See Also
    IQueryNodeProcessor

    Process(IQueryNode)

    Processes a query node tree. It may return the same or another query tree. I should never return null.

    Declaration
    public virtual IQueryNode Process(IQueryNode queryTree)
    Parameters
    Type Name Description
    IQueryNode queryTree

    tree root node

    Returns
    Type Description
    IQueryNode

    the processed query tree

    See Also
    IQueryNodeProcessor

    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

    See Also
    IQueryNodeProcessor

    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
    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

    Exceptions
    Type Condition
    QueryNodeException

    if something goes wrong during the query node processing

    See Also
    IQueryNodeProcessor

    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.

    See Also
    SetQueryConfigHandler(QueryConfigHandler)
    QueryConfigHandler

    Implements

    IQueryNodeProcessor

    See Also

    IQueryNodeProcessor
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.