inner_hits: Also never serialize _index key for parent/child inner hits as the _index is always the same of the parent search hit

This commit is contained in:
Martijn van Groningen 2016-06-21 18:23:40 +02:00
parent 0488372c20
commit b32d9a71e4
2 changed files with 1 additions and 2 deletions

View File

@ -68,7 +68,6 @@ public final class InnerHitsFetchSubPhase implements FetchSubPhase {
for (int i = 0; i < internalHits.length; i++) {
ScoreDoc scoreDoc = topDocs.scoreDocs[i];
InternalSearchHit searchHitFields = internalHits[i];
searchHitFields.shard(innerHits.shardTarget());
searchHitFields.score(scoreDoc.score);
if (scoreDoc instanceof FieldDoc) {
FieldDoc fieldDoc = (FieldDoc) scoreDoc;

View File

@ -78,7 +78,7 @@ setup:
- match: { hits.hits.0._index: "test" }
- match: { hits.hits.0._type: "type_2" }
- match: { hits.hits.0._id: "1" }
- match: { hits.hits.0.inner_hits.type_3.hits.hits.0._index: "test" }
- is_false: hits.hits.0.inner_hits.type_3.hits.hits.0._index
- match: { hits.hits.0.inner_hits.type_3.hits.hits.0._type: "type_3" }
- match: { hits.hits.0.inner_hits.type_3.hits.hits.0._id: "1" }
- is_false: hits.hits.0.inner_hits.type_3.hits.hits.0._nested