Skip to content

Commit 35e8dce

Browse files
committed
Remove needless changes
1 parent c89d103 commit 35e8dce

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

server/src/main/java/org/elasticsearch/search/fetch/FetchPhase.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -458,9 +458,8 @@ private static HitContext prepareNestedHitContext(
458458
rootId = leafRootLoader.id();
459459

460460
if (requiresSource) {
461-
BytesReference source = leafRootLoader.source();
462-
if (source != null) {
463-
rootSource = Source.fromBytes(source);
461+
if (leafRootLoader.source() != null) {
462+
rootSource = Source.fromBytes(leafRootLoader.source());
464463
}
465464
}
466465
}
@@ -471,8 +470,6 @@ private static HitContext prepareNestedHitContext(
471470
assert nestedIdentity != null;
472471
Source nestedSource = nestedIdentity.extractSource(rootSource);
473472

474-
// nested hits do not record their source size, as the top level hit will do so (nested hits will only reference part of the top
475-
// level source)
476473
SearchHit nestedHit = new SearchHit(topDocId, rootId, nestedIdentity);
477474
return new HitContext(nestedHit, subReaderContext, nestedInfo.doc(), childFieldLoader.storedFields(), nestedSource, rankDoc);
478475
}

0 commit comments

Comments
 (0)