lucene 4: Fixed TERM_FACTORY usage in VersionFetchSubPhase class.
This commit is contained in:
parent
03a16ac7d8
commit
9f45b683d6
|
@ -20,6 +20,7 @@
|
||||||
package org.elasticsearch.search.fetch.version;
|
package org.elasticsearch.search.fetch.version;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
import org.apache.lucene.index.Term;
|
||||||
import org.elasticsearch.ElasticSearchException;
|
import org.elasticsearch.ElasticSearchException;
|
||||||
import org.elasticsearch.common.lucene.uid.UidField;
|
import org.elasticsearch.common.lucene.uid.UidField;
|
||||||
import org.elasticsearch.index.mapper.internal.UidFieldMapper;
|
import org.elasticsearch.index.mapper.internal.UidFieldMapper;
|
||||||
|
@ -59,7 +60,7 @@ public class VersionFetchSubPhase implements FetchSubPhase {
|
||||||
// it might make sense to cache the TermDocs on a shared fetch context and just skip here)
|
// it might make sense to cache the TermDocs on a shared fetch context and just skip here)
|
||||||
// it is going to mean we work on the high level multi reader and not the lower level reader as is
|
// it is going to mean we work on the high level multi reader and not the lower level reader as is
|
||||||
// the case below...
|
// the case below...
|
||||||
long version = UidField.loadVersion(hitContext.reader(), UidFieldMapper.TERM_FACTORY.createTerm(hitContext.doc().get(UidFieldMapper.NAME)));
|
long version = UidField.loadVersion(hitContext.readerContext(), new Term(UidFieldMapper.NAME, hitContext.doc().get(UidFieldMapper.NAME)));
|
||||||
if (version < 0) {
|
if (version < 0) {
|
||||||
version = -1;
|
version = -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue