Re: Getting most occurring words in lucene

2015-02-22 Thread Michael McCandless
Use TermsEnum.totalTermFreq(), which is the total number of occurrences of the term, not TermsEnum.docFreq(), which is the number of documents that contain at least one occurrence of the term. Mike McCandless http://blog.mikemccandless.com On Sun, Feb 22, 2015 at 6:47 AM, Maisnam Ns wrote: > H

Getting most occurring words in lucene

2015-02-22 Thread Maisnam Ns
Hi, I am trying to get the top occurring words by building a memory index using lucene using the code below but I am not getting the desired results. The text contains 'freedom' three times but it gives only 1. Where am I committing a mistake. Is there a way out. Please help. RAMDirectory idx = n