From 9f45b683d672353a1c352b489c615a5d4276f354 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Tue, 30 Oct 2012 23:21:44 +0100 Subject: [PATCH] lucene 4: Fixed TERM_FACTORY usage in VersionFetchSubPhase class. --- .../search/fetch/version/VersionFetchSubPhase.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/elasticsearch/search/fetch/version/VersionFetchSubPhase.java b/src/main/java/org/elasticsearch/search/fetch/version/VersionFetchSubPhase.java index f5342822739..ed208fdf08b 100644 --- a/src/main/java/org/elasticsearch/search/fetch/version/VersionFetchSubPhase.java +++ b/src/main/java/org/elasticsearch/search/fetch/version/VersionFetchSubPhase.java @@ -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; }