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(Int32).
Inheritance
System.Object
Similarity.SimScorer
Namespace: Lucene.Net.Search.Similarities
Assembly: Lucene.Net.dll
Syntax
public abstract class SimScorer : object
Constructors
| Improve this Doc View SourceSimScorer()
Sole constructor. (For invocation by subclass constructors, typically implicit.)
Declaration
public SimScorer()
Methods
| Improve this Doc View SourceComputePayloadFactor(Int32, Int32, Int32, 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 |
---|---|---|
System.Int32 | doc | |
System.Int32 | start | |
System.Int32 | end | |
BytesRef | payload |
Returns
Type | Description |
---|---|
System.Single |
ComputeSlopFactor(Int32)
Computes the amount of a sloppy phrase match, based on an edit distance.
Declaration
public abstract float ComputeSlopFactor(int distance)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | distance |
Returns
Type | Description |
---|---|
System.Single |
Explain(Int32, Explanation)
Explain the score for a single document
Declaration
public virtual Explanation Explain(int doc, Explanation freq)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | 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(Int32, Single)
Score a single document
Declaration
public abstract float Score(int doc, float freq)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | doc | document id within the inverted index segment |
System.Single | freq | sloppy term frequency |
Returns
Type | Description |
---|---|
System.Single | document's score |