On 12/22/06, Mark Miller <[EMAIL PROTECTED]> 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.
Right.
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 counting. -Yonik http://incubator.apache.org/solr Solr, the open-source Lucene search server --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]