score

abstract fun score(freq: Float, norm: Long): Float

Score a single document. freq is the document-term sloppy frequency and must be finite and positive. norm is the encoded normalization factor as computed by at index time, or 1 if norms are disabled. norm is never 0.

Score must not decrease when freq increases, ie. if freq1 > freq2, then score(freq1, norm) >= score(freq2, norm) for any value of norm that may be produced by Similarity.computeNorm.

Score must not increase when the unsigned norm increases, ie. if Long.compareUnsigned(norm1, norm2) > 0 then score(freq, norm1) <= score(freq, norm2) for any legal freq.

As a consequence, the maximum score that this scorer can produce is bound by score(Float.MAX_VALUE, 1).

Return

document's score

Parameters

freq

sloppy term frequency, must be finite and positive

norm

encoded normalization factor or 1 if norms are disabled