Hi all
I have a problem with get frequency of word in nutch :|
in Lucene it quite easy through this code :

Directory dir2 = FSDirectory.open(new File(indexDir));
    IndexReader ir = IndexReader.open(dir2); 
    TermDocs termDocs = ir.termDocs(new Term("contents", "eBank"));
    int count = 0;
    while (termDocs.next()) {
       count += termDocs.freq();
    }

But in nutch, the indexer quite weird so i can't do the same thing 

 Directory dir2 = FSDirectory.open(new File("D:\\nutch\\crawl\\indexes"));
    IndexReader ir = IndexReader.open(dir2); 
    TermDocs termDocs = ir.termDocs(new Term("contents", "eBank"));
    int count = 0;
    while (termDocs.next()) {
       count += termDocs.freq();
    }



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Get-frequency-of-word-tp3095236p3095236.html
Sent from the Nutch - User mailing list archive at Nabble.com.

Reply via email to