-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Integration
-
Fully Compatible
-
ALL
$unionWIth $search explain errors out when using $search and $$SEARCH_META in the subpipeline since SEARCH_META is used in the original run of the pipeline which seems to add it in the let variables. Then when $unionWith reruns the pipeline for explain, it errors due to SEARCH_META not being allowed to be in the letVariables.
pipeline: [{ $unionWith: { coll: searchColl.getName(), pipeline: [ {$search: mongotQuery}, { $project: { "_id": 0, "ref_id": "$_id", "title": "$title", "searchMeta": "$$SEARCH_META", } } ] } }]
A possible solution is to clear SEARCH_META from the let variables.