Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class SpanNotQuery

    Removes matches which overlap with another SpanQuery or within a x tokens before or y tokens after another SpanQuery.

    Inheritance
    object
    Query
    SpanQuery
    SpanNotQuery
    Inherited Members
    SpanQuery.CreateWeight(IndexSearcher)
    Query.Boost
    Query.ToString()
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Lucene.Net.Search.Spans
    Assembly: Lucene.Net.dll
    Syntax
    public class SpanNotQuery : SpanQuery

    Constructors

    SpanNotQuery(SpanQuery, SpanQuery)

    Construct a SpanNotQuery matching spans from include which have no overlap with spans from exclude.

    Declaration
    public SpanNotQuery(SpanQuery include, SpanQuery exclude)
    Parameters
    Type Name Description
    SpanQuery include
    SpanQuery exclude

    SpanNotQuery(SpanQuery, SpanQuery, int)

    Construct a SpanNotQuery matching spans from include which have no overlap with spans from exclude within dist tokens of include.

    Declaration
    public SpanNotQuery(SpanQuery include, SpanQuery exclude, int dist)
    Parameters
    Type Name Description
    SpanQuery include
    SpanQuery exclude
    int dist

    SpanNotQuery(SpanQuery, SpanQuery, int, int)

    Construct a SpanNotQuery matching spans from include which have no overlap with spans from exclude within pre tokens before or post tokens of include.

    Declaration
    public SpanNotQuery(SpanQuery include, SpanQuery exclude, int pre, int post)
    Parameters
    Type Name Description
    SpanQuery include
    SpanQuery exclude
    int pre
    int post

    Properties

    Exclude

    Return the SpanQuery whose matches must not overlap those returned.

    Declaration
    public virtual SpanQuery Exclude { get; }
    Property Value
    Type Description
    SpanQuery

    Field

    Returns the name of the field matched by this query.

    Note that this may return null if the query matches no terms.
    Declaration
    public override string Field { get; }
    Property Value
    Type Description
    string
    Overrides
    SpanQuery.Field

    Include

    Return the SpanQuery whose matches are filtered.

    Declaration
    public virtual SpanQuery Include { get; }
    Property Value
    Type Description
    SpanQuery

    Methods

    Clone()

    Returns a clone of this query.

    Declaration
    public override object Clone()
    Returns
    Type Description
    object
    Overrides
    Query.Clone()

    Equals(object)

    Returns true if o is equal to this.

    Declaration
    public override bool Equals(object o)
    Parameters
    Type Name Description
    object o
    Returns
    Type Description
    bool
    Overrides
    Query.Equals(object)

    ExtractTerms(ISet<Term>)

    Expert: adds all terms occurring in this query to the terms set. Only works if this query is in its rewritten (Rewrite(IndexReader)) form.

    Declaration
    public override void ExtractTerms(ISet<Term> terms)
    Parameters
    Type Name Description
    ISet<Term> terms
    Overrides
    Query.ExtractTerms(ISet<Term>)
    Exceptions
    Type Condition
    InvalidOperationException

    If this query is not yet rewritten

    GetHashCode()

    Serves as the default hash function.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A hash code for the current object.

    Overrides
    Query.GetHashCode()

    GetSpans(AtomicReaderContext, IBits, IDictionary<Term, TermContext>)

    Expert: Returns the matches for this query in an index. Used internally to search for spans.

    Declaration
    public override Spans GetSpans(AtomicReaderContext context, IBits acceptDocs, IDictionary<Term, TermContext> termContexts)
    Parameters
    Type Name Description
    AtomicReaderContext context
    IBits acceptDocs
    IDictionary<Term, TermContext> termContexts
    Returns
    Type Description
    Spans
    Overrides
    SpanQuery.GetSpans(AtomicReaderContext, IBits, IDictionary<Term, TermContext>)

    Rewrite(IndexReader)

    Expert: called to re-write queries into primitive queries. For example, a PrefixQuery will be rewritten into a BooleanQuery that consists of TermQuerys.

    Declaration
    public override Query Rewrite(IndexReader reader)
    Parameters
    Type Name Description
    IndexReader reader
    Returns
    Type Description
    Query
    Overrides
    Query.Rewrite(IndexReader)

    ToString(string)

    Prints a query to a string, with field assumed to be the default field and omitted.

    Declaration
    public override string ToString(string field)
    Parameters
    Type Name Description
    string field
    Returns
    Type Description
    string
    Overrides
    Query.ToString(string)
    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.