Rename DocIdAndVersion.reader to DocIdAndVersion.context to avoid confusion.

This commit is contained in:
Adrien Grand 2013-07-15 14:21:35 +02:00
parent 9e8c42f0c6
commit 1310f02e6c
3 changed files with 7 additions and 7 deletions

View File

@ -110,7 +110,7 @@ public class TransportExplainAction extends TransportShardSingleOperationAction<
try {
context.parsedQuery(parseQuery(request, indexService));
context.preProcess();
int topLevelDocId = result.docIdAndVersion().docId + result.docIdAndVersion().reader.docBase;
int topLevelDocId = result.docIdAndVersion().docId + result.docIdAndVersion().context.docBase;
Explanation explanation;
if (context.rescore() != null) {
RescoreSearchContext ctx = context.rescore();

View File

@ -42,12 +42,12 @@ public class Versions {
public static class DocIdAndVersion {
public final int docId;
public final long version;
public final AtomicReaderContext reader;
public final AtomicReaderContext context;
public DocIdAndVersion(int docId, long version, AtomicReaderContext reader) {
public DocIdAndVersion(int docId, long version, AtomicReaderContext context) {
this.docId = docId;
this.version = version;
this.reader = reader;
this.context = context;
}
}

View File

@ -315,7 +315,7 @@ public class ShardGetService extends AbstractIndexShardComponent {
FieldsVisitor fieldVisitor = buildFieldsVisitors(gFields);
if (fieldVisitor != null) {
try {
docIdAndVersion.reader.reader().document(docIdAndVersion.docId, fieldVisitor);
docIdAndVersion.context.reader().document(docIdAndVersion.docId, fieldVisitor);
} catch (IOException e) {
throw new ElasticSearchException("Failed to get type [" + type + "] and id [" + id + "]", e);
}
@ -340,7 +340,7 @@ public class ShardGetService extends AbstractIndexShardComponent {
searchLookup = new SearchLookup(mapperService, fieldDataService, new String[]{type});
}
SearchScript searchScript = scriptService.search(searchLookup, "mvel", field, null);
searchScript.setNextReader(docIdAndVersion.reader);
searchScript.setNextReader(docIdAndVersion.context);
searchScript.setNextDocId(docIdAndVersion.docId);
try {
@ -356,7 +356,7 @@ public class ShardGetService extends AbstractIndexShardComponent {
if (x == null || !x.mapper().fieldType().stored()) {
if (searchLookup == null) {
searchLookup = new SearchLookup(mapperService, fieldDataService, new String[]{type});
searchLookup.setNextReader(docIdAndVersion.reader);
searchLookup.setNextReader(docIdAndVersion.context);
searchLookup.setNextDocId(docIdAndVersion.docId);
}
value = searchLookup.source().extractValue(field);