Extract the high frequent terms in the search result set.

I need to know how to extract the most frequent terms in the search result
set after submitting the query.

Here the class where you can use to extract the most frequent terms from the
index:

int j=0;
                int numTerms=5;
                 TermEnum terms = r.terms(); 
                
                TermDocs dok = r.termDocs();
                
                
                 TermInfoQueue tiq = new TermInfoQueue(numTerms);
                   
  while (terms.next()) {
          tiq.insert(new TermInfo(terms.term(), terms.docFreq()));
                        }
                     
                      while (tiq.size() > 0) {
                        
                        TermInfo termInfo = (TermInfo) tiq.pop();
                    
                        if(termInfo.docFreq>=70)
                        {
                      
                     System.out.println(termInfo.term.text() + "     " +
termInfo.docFreq);
                       
                   
                         j++;
                         
                      }
                       
                    
                      }

Is there a way to apply this class only in the result of the search?

Thanks in advance

-- 
View this message in context: 
http://lucene.472066.n3.nabble.com/high-frequent-terms-in-the-search-result-set-tp1862280p1862280.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to