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 RobertMuir
Date Thu, 03 Nov 2011 23:15:58 GMT
Dear Wiki user,

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

The "ImproveSearchingSpeed" page has been changed by RobertMuir:
http://wiki.apache.org/lucene-java/ImproveSearchingSpeed?action=diff&rev1=13&rev2=14

Comment:
die optimize die

  
   You must re-open the [[http://lucene.apache.org/java/docs/api/org/apache/lucene/search/IndexSearcher.html|IndexSearcher]]
in order to make newly committed changes visible to searching.  However, re-opening the searcher
has a certain overhead (noticeable mostly with large indexes and with sorting turned on) and
should thus be minimized.  Consider using a so called [[http://wiki.apache.org/solr/SolrCaching|warming]]
technique which allows the searcher to warm up its caches before the first query hits.
  
-  * '''Run [[http://lucene.apache.org/java/docs/api/org/apache/lucene/index/IndexWriter.html#optimize()|optimize]]
on your index before searching.'''
- 
-  An optimized index has only 1 segment to search which can be much faster than the many
segments that will normally be created, especially for a large index.  If your application
does not often update the index then it pays to build the index, optimize it, and use the
optimized one for searching.  If instead you are frequently updating the index and then refreshing
searchers, then optimizing will likely be too costly and you should decrease mergeFactor instead.
- 
   * '''Decrease [[http://lucene.apache.org/java/docs/api/org/apache/lucene/index/IndexWriter.html#setMergeFactor(int)|mergeFactor]].'''
  
   Smaller mergeFactors mean fewer segments and searching will be faster.  However, this will
slow down indexing speed, so you should test values to strike an appropriate balance for your
application.

Mime
View raw message