Align $rankFusion builder validation and overload structure with $scoreFusion

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: Builders
    • None
    • Dotnet Drivers
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      Background

      While working on CSHARP-5931 ($scoreFusion builder), I designed the three public ScoreFusion overloads such that each public overload validates its own input shape (with the correct paramName), then delegates to a private ScoreFusionCore for cross-cutting options validation and BSON rendering. Also, error messages were standardized to BCL-style phrasing (e.g. "Value cannot be an empty collection.", "Value cannot contain a null pipeline.").

      $rankFusion (added in CSHARP-5478) does not follow this pattern. It has the same three-overload shape but:

      • The dictionary overload does not validate that pipelines is non-empty.
      • The array and tuple overloads delegate to the dictionary overload, so empty/null-entry errors surface with paramName: "pipelines" even when the caller used the array or tuple overload (the tuple overload's user-facing parameter is pipelinesWithWeights).
      • The tuple overload always passes the constructed weights dictionary through, even when empty — emitting combination: { weights: { } }}} for an all-null-weight tuple input. {{$scoreFusion collapses this case to no combination block.

      The aim of this ticket to refactor $rankFusion to follow the same pattern as $scoreFusion since they are similar stages. 

            Assignee:
            Unassigned
            Reporter:
            Adelin Mbida Owona
            None
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: