Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class PayloadNearQuery

    This class is very similar to SpanNearQuery except that it factors in the value of the payloads located at each of the positions where the TermSpans occurs.

    NOTE: In order to take advantage of this with the default scoring implementation (DefaultSimilarity), you must override ScorePayload(int, int, int, BytesRef), which returns 1 by default.

    Payload scores are aggregated using a pluggable PayloadFunction.
    Inheritance
    object
    Query
    SpanQuery
    SpanNearQuery
    PayloadNearQuery
    Inherited Members
    SpanNearQuery.m_clauses
    SpanNearQuery.m_slop
    SpanNearQuery.m_inOrder
    SpanNearQuery.m_field
    SpanNearQuery.GetClauses()
    SpanNearQuery.Slop
    SpanNearQuery.IsInOrder
    SpanNearQuery.Field
    SpanNearQuery.ExtractTerms(ISet<Term>)
    SpanNearQuery.GetSpans(AtomicReaderContext, IBits, IDictionary<Term, TermContext>)
    SpanNearQuery.Rewrite(IndexReader)
    Query.Boost
    Query.ToString()
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Lucene.Net.Search.Payloads
    Assembly: Lucene.Net.dll
    Syntax
    public class PayloadNearQuery : SpanNearQuery

    Constructors

    PayloadNearQuery(SpanQuery[], int, bool)

    This class is very similar to SpanNearQuery except that it factors in the value of the payloads located at each of the positions where the TermSpans occurs.

    NOTE: In order to take advantage of this with the default scoring implementation (DefaultSimilarity), you must override ScorePayload(int, int, int, BytesRef), which returns 1 by default.

    Payload scores are aggregated using a pluggable PayloadFunction.
    Declaration
    public PayloadNearQuery(SpanQuery[] clauses, int slop, bool inOrder)
    Parameters
    Type Name Description
    SpanQuery[] clauses
    int slop
    bool inOrder
    See Also
    ComputePayloadFactor(int, int, int, BytesRef)

    PayloadNearQuery(SpanQuery[], int, bool, PayloadFunction)

    This class is very similar to SpanNearQuery except that it factors in the value of the payloads located at each of the positions where the TermSpans occurs.

    NOTE: In order to take advantage of this with the default scoring implementation (DefaultSimilarity), you must override ScorePayload(int, int, int, BytesRef), which returns 1 by default.

    Payload scores are aggregated using a pluggable PayloadFunction.
    Declaration
    public PayloadNearQuery(SpanQuery[] clauses, int slop, bool inOrder, PayloadFunction function)
    Parameters
    Type Name Description
    SpanQuery[] clauses
    int slop
    bool inOrder
    PayloadFunction function
    See Also
    ComputePayloadFactor(int, int, int, BytesRef)

    Fields

    m_fieldName

    This class is very similar to SpanNearQuery except that it factors in the value of the payloads located at each of the positions where the TermSpans occurs.

    NOTE: In order to take advantage of this with the default scoring implementation (DefaultSimilarity), you must override ScorePayload(int, int, int, BytesRef), which returns 1 by default.

    Payload scores are aggregated using a pluggable PayloadFunction.
    Declaration
    protected string m_fieldName
    Field Value
    Type Description
    string
    See Also
    ComputePayloadFactor(int, int, int, BytesRef)

    m_function

    This class is very similar to SpanNearQuery except that it factors in the value of the payloads located at each of the positions where the TermSpans occurs.

    NOTE: In order to take advantage of this with the default scoring implementation (DefaultSimilarity), you must override ScorePayload(int, int, int, BytesRef), which returns 1 by default.

    Payload scores are aggregated using a pluggable PayloadFunction.
    Declaration
    protected PayloadFunction m_function
    Field Value
    Type Description
    PayloadFunction
    See Also
    ComputePayloadFactor(int, int, int, BytesRef)

    Methods

    Clone()

    Returns a clone of this query.

    Declaration
    public override object Clone()
    Returns
    Type Description
    object
    Overrides
    SpanNearQuery.Clone()
    See Also
    ComputePayloadFactor(int, int, int, BytesRef)

    CreateWeight(IndexSearcher)

    Expert: Constructs an appropriate Weight implementation for this query.

    Only implemented by primitive queries, which re-write to themselves.
    Declaration
    public override Weight CreateWeight(IndexSearcher searcher)
    Parameters
    Type Name Description
    IndexSearcher searcher
    Returns
    Type Description
    Weight
    Overrides
    SpanQuery.CreateWeight(IndexSearcher)
    See Also
    ComputePayloadFactor(int, int, int, BytesRef)

    Equals(object)

    Returns true iff

    o
    is equal to this.
    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj
    Returns
    Type Description
    bool
    Overrides
    SpanNearQuery.Equals(object)
    See Also
    ComputePayloadFactor(int, int, int, BytesRef)

    GetHashCode()

    Serves as the default hash function.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A hash code for the current object.

    Overrides
    SpanNearQuery.GetHashCode()
    See Also
    ComputePayloadFactor(int, int, int, BytesRef)

    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
    SpanNearQuery.ToString(string)
    See Also
    ComputePayloadFactor(int, int, int, BytesRef)

    See Also

    ComputePayloadFactor(int, int, int, BytesRef)
    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.