lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maurice Coyle <>
Subject best way of reusing IndexSearcher objects
Date Wed, 05 Nov 2003 16:13:40 GMT
hi all,
i have a fairly big index (relative to the computing power at my disposal),
which takes a little too long for my liking to open if i run a lot of
queries through it in sequence.  i've worked out that the bottleneck is the
opening of the index since when i run the queries through a much smaller
index they run much faster.

so in my code i have a single IndexSearcher object which i re-use to perform
each search (with a different Query each time).  i've decuded from the
archives that this is ok, i.e. it's safe to re-use an IndexSearcher object.

what i was wondering was whether i should proceed as i am, i.e. reusing an
IndexSearcher object which is created at the start of my program, or at the
beginning of my program open an IndexReader object which will be passed to
the constructor of a new IndexSearcher object for each query.

or to put it simply, are both solutions as effective/efficient as each


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

View raw message