lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: IndexSearcher
Date Thu, 23 Feb 2006 00:02:14 GMT
: I have one index where the instantiation is very fast, to the point where I
: don't need to do any pooling.  A new index I have created, takes a very long
: time to create the IndexSearcher object.  With a 30mb index, it can take
: about 30 seconds just to instantiate an IndexSearcher().  It almost seems
: like it is reading the index at that point.
:
:
: The only difference between the indexes has been the # of fields indexed.
: The newer one only having one field indexed.

If i remember correctly, The IndexSearcher constructor doesn't do anything
but open an IndexReader ... IndexReader.open() opens a MultiReader on all
of the segments, and each of the SegmentReaders open up a bunch of files.

so off hte top of my head, one thing that can make a differnece in the
"new IndexSearcher" times, is how many segments you have in your index
(ie: is it optimized?) ... using the compound fileformat can probably make
a difference as well.

: Any ways to speed up that instantiation? Or do I have to use a pooling
: system?

Even if you get it down to 0.00001 seconds,i would still reuse the same
IndexSearcher as much as possible.  See previous replies from me in
the archive about memory for my reasoning.



-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message