SERVER-131820ClosedFixed
Shard-side merge of a sharded $search query loses SEARCH_META metadata cursors
h2. Summary When mongos delegates the merging half of a sharded {{$search}} query that references {{$$SEARCH\_META}} to a shard, the metadata {{$mergeCursors}} that mongos injected into the {{$setVariableFromSubPipeline}} sub\-pipeline does not survive serialization to the merging shard. The shard reparses the sub\-pipeline as the bare {{planShardedSearch}} metaPipeline \(e.g. {{\[$group, $facet, $replaceRoot\]}}\), whose front stage requires an input source, and the first {{doGetNext\(\)}} hits