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 "LuceneFAQ" by MikeMcCandless
Date Sun, 10 Jun 2007 09:09:32 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 MikeMcCandless:
http://wiki.apache.org/lucene-java/LuceneFAQ

------------------------------------------------------------------------------
  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.
  
  ==== How do I speed up searching? ====
+ 
+ See ImproveSearchingSpeed.
  
    * Don't iterate over more hits than needed (see question above).
    * Do not re-open the !IndexReader/!IndexSearcher more often than necessary. In other words,
open them once and then make many searches. Re-opening the !IndexReader has a certain overhead
(noticeable mostly with large indexes and with sorting turned on) and should thus be avoided.
Also take this overhead into account when making performance tests (i.e. don't measure the
first searches).

Mime
View raw message