Skip to content

Commit b503fa1

Browse files
committed
Ran generate
1 parent eece40e commit b503fa1

File tree

6 files changed

+251
-5
lines changed

6 files changed

+251
-5
lines changed

generator/config/stage/scoreFusion.yaml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,36 @@
1-
# $schema: ../schema.json
1+
# yaml-language-server: $schema=../schema.json
22
name: $scoreFusion
33
link: 'https://www.mongodb.com/docs/manual/reference/operator/aggregation/scoreFusion/'
44
type:
55
- stage
6-
encode: single
6+
encode: object
77
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).
8+
Combines multiple pipelines using relative score fusion to create hybrid search results.
99
arguments:
1010
-
11-
name: skip
11+
name: input
1212
type:
13-
- int
13+
- object
14+
description: |
15+
An object with the following required fields:
16+
- input.pipelines: Map from name to input pipeline. Each pipeline must be operating on the same collection. Minimum of one pipeline.
17+
- input.normalization: Normalizes the score to the range 0 to 1 before combining the results. Value can be none, sigmoid or minMaxScaler.
18+
-
19+
name: combination
20+
optional: true
21+
type:
22+
- object
23+
description: |
24+
An object with the following optional fields:
25+
- combination.weights: Map from pipeline name to numbers (non-negative). If unspecified, default weight is 1 for each pipeline.
26+
- combination.method: Specifies method for combining scores. Value can be avg or expression. Default is avg.
27+
- combination.expression: This is the custom expression that is used when combination.method is set to expression.
28+
-
29+
name: scoreDetails
30+
type:
31+
- bool
32+
default: false
33+
description: Set to true to include detailed scoring information.
1434
tests:
1535
-
1636
name: 'Example'

src/Builder/Stage/FactoryTrait.php

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Builder/Stage/FluentFactoryTrait.php

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Builder/Stage/ScoreFusionStage.php

Lines changed: 68 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/Builder/Stage/Pipelines.php

Lines changed: 93 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace MongoDB\Tests\Builder\Stage;
6+
7+
use MongoDB\Builder\Pipeline;
8+
use MongoDB\Tests\Builder\PipelineTestCase;
9+
10+
/**
11+
* Test $scoreFusion stage
12+
*/
13+
class ScoreFusionStageTest extends PipelineTestCase
14+
{
15+
public function testExample(): void
16+
{
17+
$pipeline = new Pipeline();
18+
19+
$this->assertSamePipeline(Pipelines::ScoreFusionExample, $pipeline);
20+
}
21+
}

0 commit comments

Comments
 (0)