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 used with the -t flag it also reports their
total tf (total number of occurences) in order of highest total tfModifier and Type | Field and Description |
---|---|
static int |
DEFAULTnumTerms |
static int |
numTerms |
Constructor and Description |
---|
HighFreqTerms() |
Modifier and Type | Method and Description |
---|---|
static org.apache.lucene.misc.TermStats[] |
getHighFreqTerms(IndexReader reader,
int numTerms,
String field) |
static long |
getTotalTermFreq(IndexReader reader,
Term term) |
static void |
main(String[] args) |
static org.apache.lucene.misc.TermStats[] |
sortByTotalTermFreq(IndexReader reader,
org.apache.lucene.misc.TermStats[] terms)
Takes array of TermStats.
|
public static final int DEFAULTnumTerms
public static int numTerms
public static org.apache.lucene.misc.TermStats[] getHighFreqTerms(IndexReader reader, int numTerms, String field) throws Exception
reader
- numTerms
- field
- Exception
public static org.apache.lucene.misc.TermStats[] sortByTotalTermFreq(IndexReader reader, org.apache.lucene.misc.TermStats[] terms) throws Exception
reader
- terms
- TermStats[]Exception
public static long getTotalTermFreq(IndexReader reader, Term term) throws Exception
Exception