Hybrid Score Explain Output's Structure Diverges from Docs

hello @tobe,
Numbers that you’re getting are correct. My understanding it that you’re expect the score to be divided by the number of queries (2). But the actual implementation (correctly matching the documentation) divides by the sum of weights.

The OpenSearch documentation for the normalization processor with arithmetic_mean combination technique correctly describes the formula as:

score = (weight1*score1 + weight2*score2 +...+ weightN*scoreN)/(weight1 + weight2 + ... + weightN)

Using the values from the user’s example:

  • 0.81662357 * 0.7 + 0.54727983 * 0.3 = 0.735820448
  • Since weights sum to 1.0 (as required by the implementation), this equals 0.735820448

The calculated value matches the reported value of 0.73567706 (small difference due to floating-point precision).

This is a weighted arithmetic mean formula that divides by the sum of weights, not by the number of queries.

Since the weights must sum to 1.0 (enforced by validation code), the division doesn’t change the final value in this case, which may have contributed to the confusion.
The hybrid score explanation is functioning correctly according to both the documented and implemented formula. The observed behavior is as designed.

1 Like