Package org.apache.lucene.misc

# Class HighFreqTerms

java.lang.Object
org.apache.lucene.misc.HighFreqTerms

public class HighFreqTerms extends 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 final class`
`HighFreqTerms.DocFreqComparator`
Compares terms by docTermFreq
`static final class`
`HighFreqTerms.TotalTermFreqComparator`
Compares terms by totalTermFreq

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`DEFAULT_NUMTERMS`

## Constructor Summary

Constructors
Constructor
Description
`HighFreqTerms()`

## Method Summary

Modifier and Type
Method
Description
`static TermStats[]`
`getHighFreqTerms(IndexReader reader, int numTerms, String field, Comparator<TermStats> comparator)`
Returns TermStats[] ordered by the specified comparator
`static void`
`main(String[] args)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### DEFAULT_NUMTERMS

public static final int DEFAULT_NUMTERMS

See Also:
  - Constant Field Values

## Constructor Details

### HighFreqTerms

public HighFreqTerms()

## Method Details

### main

public static void main(String[] args) throws Exception

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`