lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From karl wettin <karl.wet...@gmail.com>
Subject Re: [ANN] Printing lucene index content
Date Sat, 03 Mar 2007 21:46:11 GMT

3 mar 2007 kl. 22.31 skrev starz10de:

>>
>> hi Karl ,
>>
>> but the problem is that the getReader is not defined for type  
>> indexReader
>> !!
>>
>> this is my code
>>
>>  IndexReader ir = IndexReader.open("index");
>>
>>       TermEnum terms=ir.terms();
>>
>>       TermEnum termEnum = ir.getReader().terms();
>>       while (termEnum.next()) {
>>          TermDocs dok = ir.getReader().termDocs();
>>          dok.seek(termEnum);
>>          while (dok.next()) {
>>            System.out.println(dok.doc() + "\t" + dok.freq() + "\t" +
>>       termEnum.term());
>>          }
>>       }
>>


Just skip the getReader(). That code I gave you accessed the  
IndexReader from an aggregation.

-- 
karl



---------------------------------------------------------------------
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