Package org.apache.lucene.misc
Class HighFreqTerms
java.lang.Object
org.apache.lucene.misc.HighFreqTerms
HighFreqTerms
class extracts the top n most frequent terms (by document frequency)
from an existing Lucene index and reports their document frequency.
If the -t flag is given, both document frequency and total tf (total number of occurrences) are reported, ordered by descending total tf.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Compares terms by docTermFreqstatic final class
Compares terms by totalTermFreq -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic TermStats[]
getHighFreqTerms
(IndexReader reader, int numTerms, String field, Comparator<TermStats> comparator) Returns TermStats[] ordered by the specified comparatorstatic void
-
Field Details
-
DEFAULT_NUMTERMS
public static final int DEFAULT_NUMTERMS- See Also:
-
-
Constructor Details
-
HighFreqTerms
public HighFreqTerms()
-
-
Method Details
-
main
- Throws:
Exception
-
getHighFreqTerms
public static TermStats[] getHighFreqTerms(IndexReader reader, int numTerms, String field, Comparator<TermStats> comparator) throws Exception Returns TermStats[] ordered by the specified comparator- Throws:
Exception
-