lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Lef" <>
Subject RE: reusing MultiSearcher vs. reusing contained IndexSearchers
Date Sun, 20 Nov 2005 16:24:44 GMT
We have a very similar situation.

We cache an IndexSearcher for each index and a MultiSearcher for each
combination. Both IndexSearchers and MultiSearchers are created on
demand (i.e. we don't prebuild every possible combination). I think
caching MultiSearchers is not necessary because it is just a thin layer
on top of IndexSearchers. On the other hand, there is no penalty in
caching MultiSearchers because they use very little memory. However it
is important that there is only one cached IndexSearcher for a given
index. So this is more or less your option #1.

I have to mention that our indexes are fairly static and the indexing
process is very controlled. We update all indexes once a day. When we
switch to the updated indexes, we just start with a clean cache and let
the garbage collector clean up the old cache. If you have indexes that
are constantly updated, you may have to be a bit more careful.

Hope this helps,


-----Original Message-----
From: Oren Shir [] 
Sent: Sunday, November 20, 2005 3:45 AM
Subject: reusing MultiSearcher vs. reusing contained IndexSearchers

I'm searching several indexes combinations on random. Which method is

1) Keep one IndexSearcher for each index, and create a new MultiSearcher
each request according to the combination needed.
2) Keep one MultiSearcher with the scope of all the indexes, and pay the
toll of searching irrelevant indexes.
3) Keep each combination of MultiSearchers.

Any other thoughts?

The reason I need this is that the indexes differ in time range of
data and scope of content, all of which I know before the query. Should
step out of the box and just store everything in one huge index? It will
solve this problem, but probably will create a hundred more...

Oren Shir

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

View raw message