lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Lucene-java Wiki] Update of "ImproveSearchingSpeed" by MarkHarwood
Date Sat, 24 Nov 2007 17:27:29 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Lucene-java Wiki" for change notification.

The following page has been changed by MarkHarwood:
http://wiki.apache.org/lucene-java/ImproveSearchingSpeed

------------------------------------------------------------------------------
  
   Iterating over all hits is slow for two reasons. Firstly, the search() method that returns
a Hits object re-executes the search internally when you need more than 100 hits. Solution:
use the search method that takes a !HitCollector instead. Secondly, the hits will probably
be spread over the disk so accessing them all requires much I/O activity. This cannot easily
be avoided unless the index is small enough to be loaded into RAM. If you don't need the complete
documents but only one (small) field you could also use the !FieldCache class to cache that
one field and have fast access to it.
  
+  * '''When using fuzzy queries use a minimum prefix length.'''
+ 
+  Fuzzy queries perform CPU-intensive string comparisons - avoid comparing all unique terms
with the user input by only examining terms starting with the first "N" characters. This prefix
length is a property on both QueryParser and FuzzyQuery - default is zero so ALL terms are
compared. 
+ 

Mime
View raw message