Class Similarity.SimScorer
API for scoring "sloppy" queries such as TermQuery, SpanQuery, and PhraseQuery.
Frequencies are floating-point values: an approximate within-document frequency adjusted for "sloppiness" by ComputeSlopFactor(int).Inherited Members
Namespace: Lucene.Net.Search.Similarities
Assembly: Lucene.Net.dll
Syntax
public abstract class Similarity.SimScorer
Constructors
SimScorer()
Sole constructor. (For invocation by subclass constructors, typically implicit.)
Declaration
protected SimScorer()
Methods
ComputePayloadFactor(int, int, int, BytesRef)
Calculate a scoring factor based on the data in the payload.
Declaration
public abstract float ComputePayloadFactor(int doc, int start, int end, BytesRef payload)
Parameters
Type | Name | Description |
---|---|---|
int | doc | |
int | start | |
int | end | |
BytesRef | payload |
Returns
Type | Description |
---|---|
float |
ComputeSlopFactor(int)
Computes the amount of a sloppy phrase match, based on an edit distance.
Declaration
public abstract float ComputeSlopFactor(int distance)
Parameters
Type | Name | Description |
---|---|---|
int | distance |
Returns
Type | Description |
---|---|
float |
Explain(int, Explanation)
Explain the score for a single document
Declaration
public virtual Explanation Explain(int doc, Explanation freq)
Parameters
Type | Name | Description |
---|---|---|
int | doc | document id within the inverted index segment |
Explanation | freq | Explanation of how the sloppy term frequency was computed |
Returns
Type | Description |
---|---|
Explanation | document's score |
Score(int, float)
Score a single document
Declaration
public abstract float Score(int doc, float freq)
Parameters
Type | Name | Description |
---|---|---|
int | doc | document id within the inverted index segment |
float | freq | sloppy term frequency |
Returns
Type | Description |
---|---|
float | document's score |