Skip to content

RCBC-554: Add support for search score fusion - #248

Merged
avsej merged 1 commit into
couchbase:mainfrom
DemetrisChr:score-fusion
Sep 8, 2026
Merged

avsej merged 1 commit into
couchbase:mainfrom
DemetrisChr:score-fusion

Conversation

@DemetrisChr

Copy link
Copy Markdown
Contributor

Motivation

As part of SDK API 3.11 support we are adding the new Scoring API which enables configuring score fusion for a hybrid FTS query.

Changes

  • Deprecate SearchOptions#disable_scoring
  • Add SearchOptions#scoring which can accept three types of scoring
    • Couchbase::SearchScoring::SearchScoringNone
      • should be used instead of SearchOptions#disable_scoring
      • cannot be set if SearchOptions#disable_scoring is set to True
    • Couchbase::SearchScoring::SearchScoringRelativeScoreFusion (Stability uncommitted)
    • Couchbase::SearchScoring::SearchScoringReciprocalRankFusion (Stability uncommitted)
  • Updated the FIT protocol mirror
  • Added support for score fusion in the FIT performer
  • Raise FeatureNotAvailable if score fusion is used with couchbase2

Results

Score fusion FIT tests pass

@DemetrisChr
DemetrisChr requested review from avsej and a balanced review from Copilot and removed request for Copilot September 8, 2026 16:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The only unresolved finding is a non-blocking documentation nit.

Pull request overview

Adds search score-fusion support across the Ruby API, native backend, Protostellar layer, and FIT performer.

Changes:

  • Adds none, reciprocal-rank, and relative-score scoring modes.
  • Validates deprecated disable_scoring interactions and transport support.
  • Updates FIT protocols, capability mapping, performer logic, and tests.
File summaries
File Description
test/search_scoring_test.rb Tests scoring modes, validation, and compatibility.
lib/couchbase/search_options.rb Defines scoring strategies.
lib/couchbase/protostellar/request_generator/search.rb Maps supported scoring and rejects unsupported fusion.
lib/couchbase/options.rb Adds scoring options and conflict validation.
fit-performer/proto/shared.exceptions.proto Synchronizes replica exceptions.
fit-performer/proto/sdk.workload.proto Synchronizes replica commands.
fit-performer/proto/sdk.search.proto Adds scoring messages and options.
fit-performer/proto/sdk.kv.replicas.proto Defines replica strategies.
fit-performer/proto/sdk.kv.options.proto Defines replica options.
fit-performer/proto/sdk.kv.commands.proto Defines replica command payloads.
fit-performer/proto/sdk.cluster.query.index_manager.proto Removes an unused import.
fit-performer/proto/sdk.caps.proto Adds score-fusion and replica capabilities.
fit-performer/proto/.clang-format Excludes mirrored schemas from formatting.
fit-performer/lib/fit/performer/service.rb Advertises score-fusion support.
fit-performer/lib/fit/performer/commands/search/search_query_command.rb Applies scoring to legacy search queries.
fit-performer/lib/fit/performer/commands/search/search_command.rb Applies scoring to search requests.
fit-performer/lib/fit/performer/commands/search/options_builder.rb Converts FIT scoring options.
ext/rcb_search.cxx Maps scoring into native requests.

Nit: In lib/couchbase/search_options.rb:1340, use the actual public type name SearchScoringNone instead of ScoringNone in the documentation.

Review details
  • Files reviewed: 19/19 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lib/couchbase/search_options.rb Outdated
@avsej
avsej merged commit 8347961 into couchbase:main Sep 8, 2026
40 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants