lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From starz10de <farag_ah...@yahoo.com>
Subject high frequent terms in the search result set
Date Mon, 08 Nov 2010 12:14:30 GMT

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-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message