Skip to content

fix(search): make vector similarity threshold configurable via AppSet… - #187

Open
Abhhiiissshhek wants to merge 1 commit into
vicharanashala:mainfrom
Abhhiiissshhek:fix/search-vector-threshold-168
Open

Abhhiiissshhek wants to merge 1 commit into
vicharanashala:mainfrom
Abhhiiissshhek:fix/search-vector-threshold-168

Conversation

@Abhhiiissshhek

Copy link
Copy Markdown

What changed

This PR fixes Issue #168 by making the vector similarity threshold configurable through the existing AppSetting infrastructure instead of using a hardcoded value (0.80).

The search controllers now read the threshold from AppSettings and pass it to applySearchThreshold(), while preserving backward compatibility through the existing default value. Regression tests have also been added for configurable threshold behaviour.

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)
  • Search (hybrid text retrieval, training stats)
  • Auth / middleware
  • Crons / schedulers
  • Observability
  • Docs

CI verification

  • cd apps/backend && npx tsc --noEmit exits 0
  • cd apps/backend && npx vitest run — unrelated existing Journey Tracks tests currently fail
  • cd apps/frontend && npx tsc --noEmit
  • cd apps/frontend && npx vitest run
  • pnpm run lint
  • GitHub Actions green
  • Tests added or updated for the change
  • Single logical change
  • Docs updated (not required)
  • Rebased onto main

Notes for reviewer

  • Added searchVectorThreshold to the existing AppSetting system.
  • Preserves the default threshold (0.80) for backward compatibility.
  • Both search controllers now use the configured threshold.
  • Added regression tests covering configurable threshold behaviour.

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