You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Gus Kormeier <gu...@altrec.com> on 2006/02/22 18:27:35 UTC

IndexSearcher

Maybe too general a question, but is there anything about creating an
IndexSearcher( directory) object that would make the instantiation really
slow?


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.

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

Thanks for any suggestions,
-Gus

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


Re: IndexSearcher

Posted by Chris Hostetter <ho...@fucit.org>.
: 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