lucene 4: Fixed TERM_FACTORY usage in VersionFetchSubPhase class.

This commit is contained in:
Martijn van Groningen 2012-10-30 23:21:44 +01:00 committed by Shay Banon
parent 03a16ac7d8
commit 9f45b683d6
1 changed files with 2 additions and 1 deletions

View File

@ -20,6 +20,7 @@
package org.elasticsearch.search.fetch.version;
import com.google.common.collect.ImmutableMap;
import org.apache.lucene.index.Term;
import org.elasticsearch.ElasticSearchException;
import org.elasticsearch.common.lucene.uid.UidField;
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 is going to mean we work on the high level multi reader and not the lower level reader as is
// 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) {
version = -1;
}