ravendb/ravendb — pull request #525 by bczifra (2013-08-01 19:32:00+00:00)
Title: IndexReader warmup plugin

Added an AbstractIndexReaderWarmer plugin that is passed the new indexreader created from the indexwriter. The plugin can then do things like initialize field cache values before the indexreader is returned. That way, the first query to hit the fieldcache for things like sorting or faceting doesn't suffer from having to wait for a regeneration of the fieldcache. This works by assigning an IndexReaderWarmersWrapper of type IndexWriter.IndexReaderWarmer as the MergedSegmentWarmer of the index writer. The IndexReaderWarmersWrapper iterates through the AbstractIndexReaderWarmer implementations and calls WarmIndexReader for each of them, passing the newly generated indexreader.