lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From starz10de <farag_ah...@yahoo.com>
Subject Re: [ANN] Printing lucene index content
Date Sat, 03 Mar 2007 16:06:18 GMT


karl wettin-3 wrote:
> 
> 
> 3 mar 2007 kl. 13.54 skrev starz10de:
> 
>> How i can print the index content in order to use them for some  
>> application.
>> I did use
>> TermEnum terms=ir.terms();
>> while (terms.next()) {
>>     	     	  System.out.println(terms.term().text());
>>       }
>>
>> I still need to print the document id and the term frequency inside  
>> each
>> document.
> 
> See TermDocs:
> 
> <http://lucene.apache.org/java/docs/api/org/apache/lucene/index/ 
> TermDocs.html>
> 
> -- 
> karl
> 
> I did try this but it is still not working
> 
> IndexReader ir = IndexReader.open("index"); 
>       
>       TermDocs dok=ir.termDocs();
>  while (dok.next()) { 
>     	  System.out.println("doc nr: "+dok.doc()+ " term freq
> :"+dok.freq()); 
>       }
> 
> any help
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Printing-lucene-index-content-tf3338412.html#a9286625
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