lucene 4: added overloaded method. To fix issue in SourceScoreOrderFragmentsBuilder and SourceSimpleFragmentsBuilder.
This commit is contained in:
parent
38dc19d8bc
commit
e33ae96b38
|
@ -20,8 +20,11 @@
|
|||
package org.elasticsearch.search.lookup;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import org.apache.lucene.index.AtomicReader;
|
||||
import org.apache.lucene.index.AtomicReaderContext;
|
||||
import org.apache.lucene.index.IndexReader;
|
||||
import org.apache.lucene.search.Scorer;
|
||||
import org.elasticsearch.ElasticSearchIllegalArgumentException;
|
||||
import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.index.cache.field.data.FieldDataCache;
|
||||
import org.elasticsearch.index.mapper.MapperService;
|
||||
|
@ -77,4 +80,14 @@ public class SearchLookup {
|
|||
sourceLookup.setNextDocId(docId);
|
||||
fieldsLookup.setNextDocId(docId);
|
||||
}
|
||||
|
||||
// Sneaky way fvh to get the ARC. See SourceScoreOrderFragmentsBuilder. Passed reader must be atomic.
|
||||
// but that is the case in SourceScoreOrderFragmentsBuilder.
|
||||
public void setNextReader(IndexReader reader) {
|
||||
if (AtomicReader.class.isInstance(reader)) {
|
||||
throw new ElasticSearchIllegalArgumentException("reader not instance of AtomicReader, but " + reader.getClass());
|
||||
}
|
||||
AtomicReaderContext context = (AtomicReaderContext) reader.getContext();
|
||||
setNextReader(context);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue