You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Damien Lust <dl...@denali.be> on 2004/02/24 17:02:18 UTC

TermDocs

I used the class TermDocs to have the <freq,doc (a number)> of a term.

I would like to retrieve the <freq,Document > of a term.

Any Ideas?

Thanks.


Here you are my code:

  // Create an IndexReader on a specific Directory
Directory directory = FSDirectory.getDirectory(lucenePathIndex,false);
IndexReader reader = IndexReader.open(directory);
	
// Enumeration of all the terms of the lucene files
TermEnum enum = reader.terms();
while (enum.next()){
	          Term term = enum.term();
			// Return the object that contains the document number and the 
frequence of the term in the doc
	        	TermDocs termDocs = reader.termDocs(term);
}