Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class ProximityQueryNode

    A ProximityQueryNode represents a query where the terms should meet specific distance conditions. (a b c) WITHIN [SENTENCE|PARAGRAPH|NUMBER] [INORDER] ("a" "b" "c") WITHIN [SENTENCE|PARAGRAPH|NUMBER] [INORDER]

    TODO: Add this to the future standard Lucene parser/processor/builder

    Inheritance
    object
    QueryNode
    BooleanQueryNode
    ProximityQueryNode
    Implements
    IQueryNode
    Inherited Members
    QueryNode.PLAINTEXT_FIELD_NAME
    QueryNode.Allocate()
    QueryNode.Add(IQueryNode)
    QueryNode.Add(IList<IQueryNode>)
    QueryNode.IsLeaf
    QueryNode.Set(IList<IQueryNode>)
    QueryNode.Clone()
    QueryNode.GetChildren()
    QueryNode.SetTag(string, object)
    QueryNode.UnsetTag(string)
    QueryNode.ContainsTag(string)
    QueryNode.GetTag(string)
    QueryNode.TryGetTag(string, out object)
    QueryNode.Parent
    QueryNode.IsRoot
    QueryNode.m_toQueryStringIgnoreFields
    QueryNode.IsDefaultField(string)
    QueryNode.TagMap
    QueryNode.RemoveChildren(IQueryNode)
    QueryNode.RemoveFromParent()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Lucene.Net.QueryParsers.Flexible.Core.Nodes
    Assembly: Lucene.Net.QueryParser.dll
    Syntax
    public class ProximityQueryNode : BooleanQueryNode, IQueryNode

    Constructors

    ProximityQueryNode(IList<IQueryNode>, string, Type, bool)

    A ProximityQueryNode represents a query where the terms should meet specific distance conditions. (a b c) WITHIN [SENTENCE|PARAGRAPH|NUMBER] [INORDER] ("a" "b" "c") WITHIN [SENTENCE|PARAGRAPH|NUMBER] [INORDER]

    TODO: Add this to the future standard Lucene parser/processor/builder

    Declaration
    public ProximityQueryNode(IList<IQueryNode> clauses, string field, ProximityQueryNode.Type type, bool inorder)
    Parameters
    Type Name Description
    IList<IQueryNode> clauses

    QueryNode children

    string field

    field name

    ProximityQueryNode.Type type

    type of proximity query

    bool inorder

    true, if the tokens should be matched in the order of the clauses

    ProximityQueryNode(IList<IQueryNode>, string, Type, int, bool)

    A ProximityQueryNode represents a query where the terms should meet specific distance conditions. (a b c) WITHIN [SENTENCE|PARAGRAPH|NUMBER] [INORDER] ("a" "b" "c") WITHIN [SENTENCE|PARAGRAPH|NUMBER] [INORDER]

    TODO: Add this to the future standard Lucene parser/processor/builder

    Declaration
    public ProximityQueryNode(IList<IQueryNode> clauses, string field, ProximityQueryNode.Type type, int distance, bool inorder)
    Parameters
    Type Name Description
    IList<IQueryNode> clauses

    QueryNode children

    string field

    field name

    ProximityQueryNode.Type type

    type of proximity query

    int distance

    positive integer that specifies the distance

    bool inorder

    true, if the tokens should be matched in the order of the clauses

    Properties

    Distance

    Gets the distance

    Declaration
    public virtual int Distance { get; }
    Property Value
    Type Description
    int

    Field

    Gets or Sets the field. Returns null if the field was not specified in the query string.

    Declaration
    public virtual string Field { get; set; }
    Property Value
    Type Description
    string

    IsInOrder

    terms must be matched in the specified order

    Declaration
    public virtual bool IsInOrder { get; }
    Property Value
    Type Description
    bool

    ProximityType

    A ProximityQueryNode represents a query where the terms should meet specific distance conditions. (a b c) WITHIN [SENTENCE|PARAGRAPH|NUMBER] [INORDER] ("a" "b" "c") WITHIN [SENTENCE|PARAGRAPH|NUMBER] [INORDER]

    TODO: Add this to the future standard Lucene parser/processor/builder

    Declaration
    public virtual ProximityQueryNode.Type ProximityType { get; }
    Property Value
    Type Description
    ProximityQueryNode.Type

    Methods

    CloneTree()

    Recursive clone the IQueryNode tree. The tags are not copied to the new tree when you call the CloneTree() method.

    Declaration
    public override IQueryNode CloneTree()
    Returns
    Type Description
    IQueryNode

    the cloned tree

    Overrides
    BooleanQueryNode.CloneTree()

    GetFieldAsString()

    Gets the field as a string. Returns null if the field was not specified in the query string.

    Declaration
    public virtual string GetFieldAsString()
    Returns
    Type Description
    string

    ToQueryString(IEscapeQuerySyntax)

    convert to a query string understood by the query parser

    Declaration
    public override string ToQueryString(IEscapeQuerySyntax escapeSyntaxParser)
    Parameters
    Type Name Description
    IEscapeQuerySyntax escapeSyntaxParser
    Returns
    Type Description
    string
    Overrides
    BooleanQueryNode.ToQueryString(IEscapeQuerySyntax)

    ToString()

    Every implementation of this class should return pseudo xml like this:

    For FieldQueryNode: <field start='1' end='2' field='subject' text='foo'/>

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    BooleanQueryNode.ToString()
    See Also
    ToString()

    Implements

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