lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley" <>
Subject Re: First search is slow after updating index .. subsequent searches very fast
Date Fri, 22 Dec 2006 19:22:29 GMT
On 12/22/06, Mark Miller <> wrote:
> So the first time you do a sort, the fieldcache is
> loaded up that stores the term to sort on for each document id.


> The actual sorting appears to happen just like with relevancy score
> sorting....using a priority queue that is loaded as a HitCollector
> visits each document.

Yes, every sorted query after the first will be pretty much the same
speed as queries sorted by relevancy.

> The way to avoid this warm up time that takes place (due to loading up
> those fieldcaches), is to pre-warm a Searcher. When an update is made to
> the index, instead of just opening a new Searcher, keep using the old
> Searcher to serve search requests, start up a new searcher in a
> different thread and perform a sorted search on it, then replace the
> stale Searcher with the new warmed up Searcher.

Yes, Solr does this warming in the background.
You also need to close the old searcher after all searches on it have
completed (for a time, searches could be running on both the old and
new searchers concurrently).  This requires something like reference

-Yonik Solr, the open-source Lucene search server

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message