jruby/docs BETA
Navigation
org.apache.lucene.search.similarities.Similarity 2
I BulkSimScorer
C SimScorer
SimScorer — members 3
M as_bulk_sim_scorer() BulkSimScorer
M explain(freq, norm) Explanation
M score(freq, norm) float

org.apache.lucene.search.similarities.Similarity.SimScorer

class abstract 3 members

Stores the weight for a query across the indexed collection. This abstract implementation is empty; descendants of Similarity should subclass SimWeight and define the statistics they require in the subclass. Examples include idf, average field length, etc.

Instance Methods

as_bulk_sim_scorer

Similarity.BulkSimScorer as_bulk_sim_scorer ( )
Java: asBulkSimScorer()

Return a BulkSimScorer that produces the exact same scores as this SimScorer but is more efficient at bulk-computing scores.

NOTE: The returned instance is not thread-safe.

explain

Explanation explain ( Explanation freq, long norm )
Java: explain(org.apache.lucene.search.Explanation freq, long norm)

Explain the score for a single document

nametypedescription
freqorg.apache.lucene.search.ExplanationExplanation of how the sloppy term frequency was computed
normlongencoded normalization factor, as returned by Similarity#computeNorm, or 1 if norms are disabled

Returns: document's score

score

float score ( float freq, long norm )
Java: score(float freq, long norm)

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 Similarity#computeNorm(FieldInvertState) 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(FieldInvertState).

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).

nametypedescription
freqfloatsloppy term frequency, must be finite and positive
normlongencoded normalization factor or 1 if norms are disabled

Returns: document's score

this work for additional information regarding copyright ownership.