private class BM25Similarity.BM25DocScorer extends Similarity.SimScorer
Modifier and Type | Field and Description |
---|---|
private float[] |
cache
precomputed norm[256] with k1 * ((1 - b) + b * dl / avgdl)
|
private float[] |
lengthCache
precomputed cache for all length values
|
private NumericDocValues |
norms |
private BM25Similarity.BM25Stats |
stats |
private float |
weightValue |
Constructor and Description |
---|
BM25DocScorer(BM25Similarity.BM25Stats stats,
int indexCreatedVersionMajor,
NumericDocValues norms) |
Modifier and Type | Method and Description |
---|---|
float |
computePayloadFactor(int doc,
int start,
int end,
BytesRef payload)
Calculate a scoring factor based on the data in the payload.
|
float |
computeSlopFactor(int distance)
Computes the amount of a sloppy phrase match, based on an edit distance.
|
Explanation |
explain(int doc,
Explanation freq)
Explain the score for a single document
|
float |
score(int doc,
float freq)
Score a single document
|
private final BM25Similarity.BM25Stats stats
private final float weightValue
private final NumericDocValues norms
private final float[] lengthCache
private final float[] cache
BM25DocScorer(BM25Similarity.BM25Stats stats, int indexCreatedVersionMajor, NumericDocValues norms) throws java.io.IOException
java.io.IOException
public float score(int doc, float freq) throws java.io.IOException
Similarity.SimScorer
score
in class Similarity.SimScorer
doc
- document id within the inverted index segmentfreq
- sloppy term frequencyjava.io.IOException
public Explanation explain(int doc, Explanation freq) throws java.io.IOException
Similarity.SimScorer
explain
in class Similarity.SimScorer
doc
- document id within the inverted index segmentfreq
- Explanation of how the sloppy term frequency was computedjava.io.IOException
public float computeSlopFactor(int distance)
Similarity.SimScorer
computeSlopFactor
in class Similarity.SimScorer
public float computePayloadFactor(int doc, int start, int end, BytesRef payload)
Similarity.SimScorer
computePayloadFactor
in class Similarity.SimScorer