mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 02:14:54 +00:00
inner hits: Use provided StreamContext instead of fetching a new one.
Closes #12905
This commit is contained in:
parent
754c1b44e7
commit
532806af1a
@ -694,9 +694,9 @@ public class InternalSearchHit implements SearchHit {
|
||||
innerHits = new HashMap<>(size);
|
||||
for (int i = 0; i < size; i++) {
|
||||
String key = in.readString();
|
||||
ShardTargetType shardTarget = InternalSearchHits.streamContext().streamShardTarget();
|
||||
InternalSearchHits value = InternalSearchHits.readSearchHits(in, InternalSearchHits.streamContext().streamShardTarget(ShardTargetType.NO_STREAM));
|
||||
InternalSearchHits.streamContext().streamShardTarget(shardTarget);
|
||||
ShardTargetType shardTarget = context.streamShardTarget();
|
||||
InternalSearchHits value = InternalSearchHits.readSearchHits(in, context.streamShardTarget(ShardTargetType.NO_STREAM));
|
||||
context.streamShardTarget(shardTarget);
|
||||
innerHits.put(key, value);
|
||||
}
|
||||
}
|
||||
@ -810,9 +810,9 @@ public class InternalSearchHit implements SearchHit {
|
||||
out.writeVInt(innerHits.size());
|
||||
for (Map.Entry<String, InternalSearchHits> entry : innerHits.entrySet()) {
|
||||
out.writeString(entry.getKey());
|
||||
ShardTargetType shardTarget = InternalSearchHits.streamContext().streamShardTarget();
|
||||
entry.getValue().writeTo(out, InternalSearchHits.streamContext().streamShardTarget(ShardTargetType.NO_STREAM));
|
||||
InternalSearchHits.streamContext().streamShardTarget(shardTarget);
|
||||
ShardTargetType shardTarget = context.streamShardTarget();
|
||||
entry.getValue().writeTo(out, context.streamShardTarget(ShardTargetType.NO_STREAM));
|
||||
context.streamShardTarget(shardTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -49,7 +49,6 @@ import static org.hamcrest.Matchers.*;
|
||||
|
||||
/**
|
||||
*/
|
||||
@LuceneTestCase.AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/12905")
|
||||
public class InnerHitsIT extends ESIntegTestCase {
|
||||
|
||||
@Test
|
||||
|
Loading…
x
Reference in New Issue
Block a user