Search scoring

class couchbase.search_scoring.ReciprocalRankFusion(rank_constant: int | None = None, window_size: int | None = None)

UNCOMMITTED This API may change in the future.

Combines FTS and vector results by rank.

Parameters:
  • rank_constant (int, optional) – The rank constant of the Reciprocal Rank Fusion formula.

  • window_size (int, optional) – How many results per list are considered for fusion.

Raises:

InvalidArgumentException – If either parameter is not an int in the range 0 to 4294967295.

class couchbase.search_scoring.RelativeScoreFusion(window_size: int | None = None)

UNCOMMITTED This API may change in the future.

Combines FTS and vector results by normalized score.

Parameters:

window_size (int, optional) – How many results per list are considered for fusion.

Raises:

InvalidArgumentException – If window_size is not an int in the range 0 to 4294967295.

class couchbase.search_scoring.ScoringNone

Disables result scoring.

This is equivalent to the deprecated disable_scoring option.

class couchbase.search_scoring.SearchScoring(strategy: str, **params: int | None)

Base class for search scoring modes.

For hybrid search, score fusion combines the FTS and vector results into one ranked list.

Available modes:

ReciprocalRankFusion: merges by rank.

RelativeScoreFusion: merges by normalized score.

ScoringNone: disables scoring.