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: Lucene search is very slow
Date Thu, 20 Oct 2005 18:26:43 GMT

: There is a lot of caching data in each index searcher. For large
: index, it's definitely a waste to re-create index searcher every time.

this is particularly true when you do sorts on specific fields, anytime
you sort on a field, your searcher/reader loads a FieldCache for that
field which contains an array for every doc in your index and the value of
that field.  In teh sample code posted, you are doing a tertiary sort --
which means every search requires loading three of these arrays, all of
which appear to be on String fields.  that's a lot of IO to get that data,
and a lot of memory to hold those arrays just to do one search and then
throw it away.

If you use one searcher for many searches, you only have to pay that
time/memory cost once.



-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