diff --git a/packages/mongodb-constants/src/stage-operators.ts b/packages/mongodb-constants/src/stage-operators.ts index 0ba36836..8f832910 100644 --- a/packages/mongodb-constants/src/stage-operators.ts +++ b/packages/mongodb-constants/src/stage-operators.ts @@ -749,6 +749,48 @@ const STAGE_OPERATORS = [ `, snippet: `{ \${1:specification(s)} +}`, + }, + { + name: '$rankFusion', + value: '$rankFusion', + label: '$rankFusion', + outputStage: false, + fullScan: false, + firstStage: false, + score: 1, + env: [ATLAS], + meta: 'stage', + version: '8.1.0', + apiVersions: [], + namespaces: [COLLECTION], + description: + 'Combines multiple pipelines using reciprocal rank fusion to create hybrid search results.', + comment: `/** + * input.pipelines: Required. Map from name to input pipeline. Each pipeline must be a Ranked Selection Pipeline operating on the same collection. Minimum of one pipeline. + * combination.weights: Optional. Map from pipeline name to numbers (non-negative). If unspecified, default weight is 1 for each pipeline. + * scoreDetails: Optional. Default false. Set to true to include detailed scoring information in {$meta: "scoreDetails"} for debugging and tuning. + */ +`, + snippet: `{ + input: { + pipelines: { + \${1:searchPipeline}: [ + {$search: {\${2:searchStage}}}, + {$limit: \${3:limit}} + ], + \${4:vectorPipeline}: [ + {$vectorSearch: {\${5:vectorSearchStage}}} + ] + } + }, + combination: { + weights: { + \${6:searchPipeline}: \${7:number}, + \${8:vectorPipeline}: \${9:number} + } + }, + scoreDetails: \${10:false} }`, }, {