Example usage for org.apache.lucene.index FieldInvertState getUniqueTermCount

List of usage examples for org.apache.lucene.index FieldInvertState getUniqueTermCount

Introduction

In this page you can find the example usage for org.apache.lucene.index FieldInvertState getUniqueTermCount.

Prototype

public int getUniqueTermCount() 

Source Link

Document

Return the number of unique terms encountered in this field.

Usage

From source file:ci6226.similiarty_lengthNorm.java

@Override
public float lengthNorm(FieldInvertState state) {
    return 1 / state.getUniqueTermCount();
}

From source file:main.BM25VASimilarity.java

License:Apache License

@Override
public final long computeNorm(FieldInvertState state) {
    final int numTerms = discountOverlaps ? state.getLength() - state.getNumOverlap() : state.getLength();
    state.getUniqueTermCount();
    //System.out.println(state.getName());
    //System.out.println(state.getUniqueTermCount());
    return encodeNormValue(state.getBoost(), numTerms);
}