add comment why and when we have a leaf reader in the warmer

This commit is contained in:
Simon Willnauer 2015-10-13 21:06:20 +02:00
parent 0ead0faa1b
commit ec60018e34
1 changed files with 3 additions and 0 deletions

View File

@ -952,6 +952,9 @@ public class InternalEngine extends Engine {
public IndexSearcher newSearcher(IndexReader reader, IndexReader previousReader) throws IOException {
IndexSearcher searcher = super.newSearcher(reader, previousReader);
if (reader instanceof LeafReader && isMergedSegment((LeafReader)reader)) {
// we call newSearcher from the IndexReaderWarmer which warms segments during merging
// in that case the reader is a LeafReader and all we need to do is to build a new Searcher
// and return it since it does it's own warming for that particular reader.
return searcher;
}
if (warmer != null) {