lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From testn <>
Subject Re: You are right but it doesn't make it faster.
Date Tue, 07 Aug 2007 00:56:42 GMT

Does it mean you already reuse IndexReader without reopening it? If you
haven't done so, please try it out. docFreq() should be really quick.

Thanks Daniel, you are completely right.
I changed the code - but it doesn't make it [noticeably faster] - probably
behind the scene it does run on the enum.
I added some kind of hash table that keeps the docfreq already read so if I
meet it again in another document I can retrieve it quickly - is there
another solution? Maybe have a separate Lucene index for this? (In this case
- can I read and write to the same index without closing it and reopening
it? I want to read from it and if I don't find the docfreq there, calculate
it and put it in the index).

10x Nir.

Daniel Naber-10 wrote:
> On Monday 06 August 2007 01:40, tierecke wrote:
>>         Term term=new Term("contents", termstr);
>>         TermEnum termenum=multireader.terms(term);
>>         int freq=termenum.docFreq();
> IndexReader has a docFreq() method, no need to get a Term enumeration.
> regards
>  Daniel

View this message in context:
Sent from the Lucene - Java Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message