List of usage examples for org.apache.lucene.search.similarities BasicStats getNumberOfDocuments
public long getNumberOfDocuments()
From source file:simfunctions.GeneralizedTfIdfSimilarity.java
@Override protected float score(BasicStats stats, float freq, float docLen) { // Return the tf-idf score (the tf being a generalized one obtained // from the Bezier curve) //float tf = tfFunc.getTFScore(freq/stats.getAvgFieldLength()); // docLen float tf = tfFunc.getTFScore(freq); // docLen float idf = (float) Math.log(stats.getNumberOfDocuments() / (double) stats.getDocFreq()); return stats.getTotalBoost() * tf * idf; }