lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mohsen Saboorian <>
Subject Re: Doesn it make sense cache IndexReader?
Date Thu, 17 Jul 2008 15:49:18 GMT

Kastern, thanks for the reply.

> IndexReader is thread-save so you don't need a cache.

If it wasn't thread-safe I may need a cache? I think the cache cannot be
used on a non-thread-safe environment since it exposes same instances to
different threads.

> Opening and closing an IndexReader takes some time. But I don't
> now if this is measurable.
> So if you know that you don't want to change a index, let the IndexReader
> open.
> (somebody disagree with me?)

My indices are readonly. Once created never change. If the memory footprint
for an open IndexReader is very low, I can keep all the gradually opened
index readers open.

> If you want to use your main memory you can switch from FSDirectory to
> RamDirectory.
> This will boost your performance for sure.

Thanks for the suggestion. I will use it for the most commonly used index.

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