-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Query Execution
-
None
-
Query Integration
-
ALL
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Description
When running an aggregation containing a $scoreFusion stage, supplying combination.expression while combination.method is not "expression" is silently accepted: the server applies the default avg method and drops the expression value without returning any error.
Verified on Server 8.3.0.
Expected behavior
The server should return a clear error rejecting the request when combination.expression is supplied without combination.method == "expression". This matches the rejection behavior for other invalid $scoreFusion configurations (e.g., combination.method: "sum" is rejected with BadValue).
Reproduction (mongosh)
db.createCollection("coll"); db.coll.insertMany([{ x: 1 }, { x: 2 }, { x: 3 }]); db.coll.aggregate([ { $scoreFusion: { input: { pipelines: { p1: [{ $score: { score: "$x", normalization: "none" } }] }, normalization: "none" }, combination: { // method: omitted; server defaults to "avg" expression: { $sum: ["$$p1"] } } } } ]);
The pipeline runs successfully and returns results; the expression is silently dropped. Setting method: "avg" explicitly produces the same silent-drop behavior.
- is related to
-
CSHARP-5931 Add builder support for $scoreFusion stage
-
- In Code Review
-