Module org.apache.lucene.sandbox
Package org.apache.lucene.sandbox.search
Class MultiNormsLeafSimScorer
java.lang.Object
org.apache.lucene.sandbox.search.MultiNormsLeafSimScorer
Scorer that sums document's norms from multiple fields.
For all fields, norms must be encoded using SmallFloat.intToByte4(int)
. This scorer also
requires that either all fields or no fields have norms enabled. Having only some fields with
norms enabled can result in errors or undefined behavior.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final float[]
Cache of decoded norms.private final NumericDocValues
private final Similarity.SimScorer
-
Constructor Summary
ConstructorsConstructorDescriptionMultiNormsLeafSimScorer
(Similarity.SimScorer scorer, LeafReader reader, Collection<CombinedFieldQuery.FieldAndWeight> normFields, boolean needsScores) Sole constructor: Score documents ofreader
withscorer
. -
Method Summary
Modifier and TypeMethodDescriptionexplain
(int doc, Explanation freqExpl) Explain the score for the provided document assuming the given term document frequency.private long
getNormValue
(int doc) (package private) Similarity.SimScorer
float
score
(int doc, float freq) Score the provided document assuming the given term document frequency.
-
Field Details
-
LENGTH_TABLE
private static final float[] LENGTH_TABLECache of decoded norms. -
scorer
-
norms
-
-
Constructor Details
-
MultiNormsLeafSimScorer
MultiNormsLeafSimScorer(Similarity.SimScorer scorer, LeafReader reader, Collection<CombinedFieldQuery.FieldAndWeight> normFields, boolean needsScores) throws IOException Sole constructor: Score documents ofreader
withscorer
.- Throws:
IOException
-
-
Method Details
-
getSimScorer
Similarity.SimScorer getSimScorer() -
getNormValue
- Throws:
IOException
-
score
Score the provided document assuming the given term document frequency. This method must be called on non-decreasing sequences of doc ids.- Throws:
IOException
- See Also:
-
explain
Explain the score for the provided document assuming the given term document frequency. This method must be called on non-decreasing sequences of doc ids.- Throws:
IOException
- See Also:
-