Class 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.

    • Constructor Detail

      • HighFreqTerms

        public HighFreqTerms()
    • 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