Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions packages/mongodb-constants/src/stage-operators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

@Anemy Anemy Jun 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't provide explicit links inside of the comment for any of the other stages, so I would prefer we keep that pattern if we can. We link to the stage's documentation in the aggregation builder, so folks can find it there:
Screenshot 2025-06-16 at 4 41 39 PM
Is that link enough? If we feel strongly we can change it.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that works!

* 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: {
\${1:searchPipeline}: \${6:number},
\${4:vectorPipeline}: \${7:number}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
\${1:searchPipeline}: \${6:number},
\${4:vectorPipeline}: \${7:number}
\${6:searchPipeline}: \${7:number},
\${8:vectorPipeline}: \${9:number}

or else, these (search and vector pipeline) will be skipped, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah nice catch. pushed up a fix.

}
},
scoreDetails: \${8:false}
}`,
},
{
Expand Down