Skip to content

fix(search): respect configured vector threshold in applySearchThreshold - #188

Open
mdsahidraza174-netizen wants to merge 1 commit into
vicharanashala:mainfrom
mdsahidraza174-netizen:fix/168-applysearchthreshold-configurable-threshold
Open

mdsahidraza174-netizen wants to merge 1 commit into
vicharanashala:mainfrom
mdsahidraza174-netizen:fix/168-applysearchthreshold-configurable-threshold

Conversation

@mdsahidraza174-netizen

Copy link
Copy Markdown

What changed

This PR fixes applySearchThreshold so that it respects the configured search.hybrid.minScore value instead of relying on a hardcoded threshold. It also updates the configuration defaults and adds tests to verify the configurable threshold behavior.

Related issue

Closes #168

Type of change

  • Bug fix
  • Feature
  • Refactor (no behaviour change)
  • Docs / comments only
  • CI / tooling

Area affected

  • Backend (Express / Mongoose)
  • Frontend (React / Vite)
  • Admin / Train tab (/admin/*)
  • Community (/community — posts, comments, auto-answer)
  • Search (hybrid text retrieval, training stats)
  • Auth / middleware / samagama.in bridge
  • Crons / schedulers / embedding-warm
  • Observability (Sentry / logging / Discord alerts)
  • Docs

CI verification

  • cd apps/backend && npx tsc --noEmit exits 0
  • cd apps/backend && npx vitest run — all tests pass
  • cd apps/frontend && npx tsc --noEmit exits 0
  • cd apps/frontend && npx vitest run — all tests pass
  • pnpm run lint — 0 errors (152 warnings is the baseline)
  • GitHub Actions green on the merge commit (CI, CodeQL, Build & Deploy)
  • Tested with a real API hit or browser interaction if behaviour changed
  • Tests added or updated for the change
  • Single logical change — unrelated fixes noted in description, not fixed here
  • Docs updated if route / API / env var / pipeline behaviour changed
  • Rebased onto main, no merge commits

Notes for reviewer

search.hybrid.minScore's default was updated from 0.3 to 0.80 to match the previously hardcoded threshold, so this change preserves the existing default behavior while making the threshold configurable. Frontend and documentation were intentionally left unchanged because this PR is limited to the backend fix for issue #168.

This branch has not been deployed

No deployments
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.

applySearchThreshold ignores configurable thresholds

1 participant