Package org.apache.lucene.misc
Class HighFreqTerms
- java.lang.Object
-
- org.apache.lucene.misc.HighFreqTerms
-
public class HighFreqTerms extends java.lang.Object
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
Nested Classes Modifier and Type Class Description static class
HighFreqTerms.DocFreqComparator
Compares terms by docTermFreqstatic class
HighFreqTerms.TotalTermFreqComparator
Compares terms by totalTermFreq
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_NUMTERMS
-
Constructor Summary
Constructors Constructor Description HighFreqTerms()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TermStats[]
getHighFreqTerms(IndexReader reader, int numTerms, java.lang.String field, java.util.Comparator<TermStats> comparator)
Returns TermStats[] ordered by the specified comparatorstatic void
main(java.lang.String[] args)
-
-
-
Field Detail
-
DEFAULT_NUMTERMS
public static final int DEFAULT_NUMTERMS
- See Also:
- Constant Field Values
-
-
Method Detail
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getHighFreqTerms
public static TermStats[] getHighFreqTerms(IndexReader reader, int numTerms, java.lang.String field, java.util.Comparator<TermStats> comparator) throws java.lang.Exception
Returns TermStats[] ordered by the specified comparator- Throws:
java.lang.Exception
-
-