jruby/docs BETA
Navigation
org.apache.lucene.search.similarities 47
C AfterEffect
C AfterEffectB
C AfterEffectL
C Axiomatic
C AxiomaticF1EXP
C AxiomaticF1LOG
C AxiomaticF2EXP
C AxiomaticF2LOG
C AxiomaticF3EXP
C AxiomaticF3LOG
C BM25Similarity
C BasicModel
C BasicModelG
C BasicModelIF
C BasicModelIn
C BasicModelIne
C BasicStats
C BooleanSimilarity
C ClassicSimilarity
C DFISimilarity
C DFRSimilarity
C Distribution
C DistributionLL
C DistributionSPL
C IBSimilarity
C Independence
C IndependenceChiSquared
C IndependenceSaturated
C IndependenceStandardized
C IndriDirichletSimilarity
C LMDirichletSimilarity
C LMJelinekMercerSimilarity
C LMSimilarity
C Lambda
C LambdaDF
C LambdaTTF
C MultiSimilarity
C Normalization
C NormalizationH1
C NormalizationH2
C NormalizationH3
C NormalizationZ
C PerFieldSimilarityWrapper
C RawTFSimilarity
C Similarity
C SimilarityBase
C TFIDFSimilarity
IndriDirichletSimilarity — members 7+
C new(collection_model, discount_overlaps, mu)
C new(collection_model, mu)
C new(mu)
C new(collection_model)
C new()
M mu() float
M name() String
from Similarity
M compute_norm(state) long
M discount_overlaps() boolean
from SimilarityBase
M scorer(boost, collection_stats, term_stats) SimScorer
from LMSimilarity
M to_string() String

org.apache.lucene.search.similarities.IndriDirichletSimilarity

class extends LMSimilarity 7 members

Bayesian smoothing using Dirichlet priors as implemented in the Indri Search engine (http://www.lemurproject.org/indri.php). Indri Dirichelet Smoothing!

tf_E + mu*P(t|D) P(t|E)= documentLength + documentMu
mu*P(t|C) + tf_D where P(t|D)= doclen + mu

A larger value for mu, produces more smoothing. Smoothing is most important for short documents where the probabilities are more granular.

Constructors

new

new ( LMSimilarity.CollectionModel collection_model, boolean discount_overlaps, float mu )
Java: <init>(org.apache.lucene.search.similarities.LMSimilarity.CollectionModel collectionModel, boolean discountOverlaps, float mu)

Instantiates the similarity with the provided parameters.

new

new ( LMSimilarity.CollectionModel collection_model, float mu )
Java: <init>(org.apache.lucene.search.similarities.LMSimilarity.CollectionModel collectionModel, float mu)

Instantiates the similarity with the provided μ parameter.

new

new ( float mu )
Java: <init>(float mu)

Instantiates the similarity with the provided μ parameter.

new

new ( LMSimilarity.CollectionModel collection_model )
Java: <init>(org.apache.lucene.search.similarities.LMSimilarity.CollectionModel collectionModel)

Instantiates the similarity with the default μ value of 2000.

new

new ( )
Java: <init>()

Instantiates the similarity with the default μ value of 2000.

Instance Methods

mu

float mu ( )
Java: getMu() · also: get_mu

Returns the μ parameter.

name

String name ( )
Java: getName() · also: get_name

Inherited

from Similarity

compute_norm

long compute_norm ( FieldInvertState state )
Java: computeNorm(org.apache.lucene.index.FieldInvertState state)

Computes the normalization value for a field at index-time.

The default implementation uses SmallFloat#intToByte4 to encode the number of terms as a single byte.

WARNING: The default implementation is used by Lucene's supplied Similarity classes, which means you can change the Similarity at runtime without reindexing. If you override this method, you'll need to re-index documents for it to take effect.

Matches in longer fields are less precise, so implementations of this method usually set smaller values when state.getLength() is large, and larger values when state.getLength() is small.

Note that for a given term-document frequency, greater unsigned norms must produce scores that are lower or equal, ie. for two encoded norms n1 and n2 so that Long.compareUnsigned(n1, n2) > 0 then SimScorer.score(freq, n1) <= SimScorer.score(freq, n2) for any legal freq.

0 is not a legal norm, so 1 is the norm that produces the highest scores.

nametypedescription
stateorg.apache.lucene.index.FieldInvertStateaccumulated state of term processing for this field

Returns: computed norm value

discount_overlaps

boolean discount_overlaps ( )
Java: getDiscountOverlaps() · also: get_discount_overlaps

Returns true if overlap tokens are discounted from the document's length.

from SimilarityBase

scorer

Similarity.SimScorer scorer ( float boost, CollectionStatistics collection_stats, TermStatistics[] term_stats )
Java: scorer(float boost, org.apache.lucene.search.CollectionStatistics collectionStats, org.apache.lucene.search.TermStatistics[] termStats)

from LMSimilarity

to_string

String to_string ( )
Java: toString()

Returns the name of the LM method. If a custom collection model strategy is used, its name is included as well.

this work for additional information regarding copyright ownership.