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.Inherited Members
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
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
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
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
See Also
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
See Also
GetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code for the current object. |