Skip to content

Fix search score and threshold handling#1020

Merged
wayyoungboy merged 1 commit into
oceanbase:mainfrom
wayyoungboy:fix/search-score-threshold
Jun 12, 2026
Merged

Fix search score and threshold handling#1020
wayyoungboy merged 1 commit into
oceanbase:mainfrom
wayyoungboy:fix/search-score-threshold

Conversation

@wayyoungboy

Copy link
Copy Markdown
Member

What changed

  • Preserve valid score=0.0 values when converting HTTP search results instead of turning them into null.
  • Add threshold support to HTTP search requests for both POST body and GET query parameters.
  • Pass the HTTP threshold value through SearchService to Memory.search().
  • Add focused unit coverage for score conversion and threshold validation/propagation.

Why

Search results can legitimately have a zero score. The API converter previously used truthiness fallback, so 0.0 was treated as missing and serialized as null when no similarity fallback existed.

HTTP users also had no way to pass the existing core search threshold even though CLI and MCP already expose similar behavior.

Validation

PYTHONPATH=src .venv/bin/python -m pytest tests/unit/server/test_search_score_threshold.py -q

Result: 7 passed.

@wayyoungboy wayyoungboy changed the title [codex] fix search score and threshold handling Fix search score and threshold handling Jun 12, 2026
@wayyoungboy wayyoungboy force-pushed the fix/search-score-threshold branch from 0e7e6bd to 2baac4b Compare June 12, 2026 12:30
@wayyoungboy wayyoungboy marked this pull request as ready for review June 12, 2026 12:30
@wayyoungboy wayyoungboy force-pushed the fix/search-score-threshold branch from 2baac4b to fe2ee29 Compare June 12, 2026 16:34
@wayyoungboy wayyoungboy force-pushed the fix/search-score-threshold branch from fe2ee29 to 4a118bb Compare June 12, 2026 16:35
@wayyoungboy wayyoungboy merged commit d657ffc into oceanbase:main Jun 12, 2026
17 checks passed
@wayyoungboy wayyoungboy deleted the fix/search-score-threshold branch June 12, 2026 17:02
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.

1 participant