FileDocCategorySizeDatePackage
DefaultSimilarity.javaAPI DocApache Lucene 2.1.01902Wed Feb 14 10:46:40 GMT 2007org.apache.lucene.search

DefaultSimilarity

public class DefaultSimilarity extends Similarity
Expert: Default scoring implementation.

Fields Summary
Constructors Summary
Methods Summary
public floatcoord(int overlap, int maxOverlap)
Implemented as overlap / maxOverlap.

    return overlap / (float)maxOverlap;
  
public floatidf(int docFreq, int numDocs)
Implemented as log(numDocs/(docFreq+1)) + 1.

    return (float)(Math.log(numDocs/(double)(docFreq+1)) + 1.0);
  
public floatlengthNorm(java.lang.String fieldName, int numTerms)
Implemented as 1/sqrt(numTerms).

    return (float)(1.0 / Math.sqrt(numTerms));
  
public floatqueryNorm(float sumOfSquaredWeights)
Implemented as 1/sqrt(sumOfSquaredWeights).

    return (float)(1.0 / Math.sqrt(sumOfSquaredWeights));
  
public floatsloppyFreq(int distance)
Implemented as 1 / (distance + 1).

    return 1.0f / (distance + 1);
  
public floattf(float freq)
Implemented as sqrt(freq).

    return (float)Math.sqrt(freq);