lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: setTermInfosIndexDivisor
Date Thu, 25 Jun 2009 10:14:10 GMT
On Thu, Jun 25, 2009 at 6:09 AM, Ganesh<> wrote:
> What about setTermInfosIndexDivisor??
> Directory dir = FSDirectory.getDirectory(indexPath);
> IndexReader reader =, true);
> reader.setTermInfosIndexDivisor(5);
> It supposed to load only one fifth of the terms available?? But there is no difference
in memory consumption with / without settings this parameter.

No, it's loads 1/5th of the 1/128th of all the terms available.  Ie,
by default Lucene loads every 128th term into RAM for searching.  If
you call setTermInfosIndexDivisor(5), then it loads every 128*5 =
every 640 terms.

> I reopen the IndexReader whenever there is any document added to Index.  Do i need to
set setTermInfosIndexDivisor(5); during re-opening of the index also. I tried this, first
time it accepted and second time onwards it throws "terms already loaded" expection

Calling setTermInfosIndexDivisor on a reopened reader won't work,
because of a [just now discovered] bug in Lucene.  The workaround (if
you really must use setTermInfosIndexDivisor) is to not use reopen.


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

View raw message