Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class PayloadTermQuery

    This class is very similar to SpanTermQuery except that it factors in the value of the payload located at each of the positions where the Term 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
    SpanTermQuery
    PayloadTermQuery
    Inherited Members
    SpanTermQuery.m_term
    SpanTermQuery.Term
    SpanTermQuery.Field
    SpanTermQuery.ExtractTerms(ISet<Term>)
    SpanTermQuery.ToString(string)
    SpanTermQuery.GetSpans(AtomicReaderContext, IBits, IDictionary<Term, TermContext>)
    Query.Boost
    Query.ToString()
    Query.Rewrite(IndexReader)
    Query.Clone()
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Lucene.Net.Search.Payloads
    Assembly: Lucene.Net.dll
    Syntax
    public class PayloadTermQuery : SpanTermQuery

    Constructors

    PayloadTermQuery(Term, PayloadFunction)

    This class is very similar to SpanTermQuery except that it factors in the value of the payload located at each of the positions where the Term 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 PayloadTermQuery(Term term, PayloadFunction function)
    Parameters
    Type Name Description
    Term term
    PayloadFunction function
    See Also
    ComputePayloadFactor(int, int, int, BytesRef)

    PayloadTermQuery(Term, PayloadFunction, bool)

    This class is very similar to SpanTermQuery except that it factors in the value of the payload located at each of the positions where the Term 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 PayloadTermQuery(Term term, PayloadFunction function, bool includeSpanScore)
    Parameters
    Type Name Description
    Term term
    PayloadFunction function
    bool includeSpanScore
    See Also
    ComputePayloadFactor(int, int, int, BytesRef)

    Fields

    m_function

    This class is very similar to SpanTermQuery except that it factors in the value of the payload located at each of the positions where the Term 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

    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)

    Determines whether the specified object is equal to the current object.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj

    The object to compare with the current object.

    Returns
    Type Description
    bool

    true if the specified object is equal to the current object; otherwise, false.

    Overrides
    SpanTermQuery.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
    SpanTermQuery.GetHashCode()
    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.