Skip to content

Commit eece40e

Browse files
committed
Add generator config for scoreFusion stage
1 parent 004a3c0 commit eece40e

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# $schema: ../schema.json
2+
name: $scoreFusion
3+
link: 'https://www.mongodb.com/docs/manual/reference/operator/aggregation/scoreFusion/'
4+
type:
5+
- stage
6+
encode: single
7+
description: |
8+
Skips the first n documents where n is the specified skip number and passes the remaining documents unmodified to the pipeline. For each input document, outputs either zero documents (for the first n documents) or one document (if after the first n documents).
9+
arguments:
10+
-
11+
name: skip
12+
type:
13+
- int
14+
tests:
15+
-
16+
name: 'Example'
17+
link: 'https://www.mongodb.com/docs/manual/reference/operator/aggregation/scoreFusion/#examples'
18+
pipeline:
19+
-
20+
$scoreFusion:
21+
input:
22+
pipelines:
23+
searchOne:
24+
-
25+
$vectorSearch:
26+
index: 'vector_index'
27+
path: 'plot_embedding'
28+
queryVector: [-0.0016261312, -0.028070757, -0.011342932]
29+
numCandidates: 150
30+
limit: 10
31+
searchTwo:
32+
-
33+
$search:
34+
index: '<INDEX_NAME>'
35+
text:
36+
query: '<QUERY_TERM>'
37+
path: '<FIELD_NAME>'
38+
normalization: 'sigmoid'
39+
combination:
40+
method: 'expression'
41+
expression:
42+
$sum:
43+
-
44+
$multiply:
45+
- '$$searchOne'
46+
- 10
47+
- '$$searchTwo'
48+
scoreDetails: true
49+
-
50+
$project:
51+
_id: 1
52+
title: 1
53+
plot: 1
54+
scoreDetails:
55+
$meta: 'scoreDetails'
56+
-
57+
$limit: 20

0 commit comments

Comments
 (0)