Repository navigation
fix(search): pick the tsvector query config from the request language - #2047
Conversation
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
Review complete. No blocking issues — approved ✅; 1 nitpick below. 🧹 Nitpicks (1) — 🟢 1 low
This PR makes full-text search respect the caller's requested language. A new
Reviewed commit: 40e90db |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
There was a problem hiding this comment.
Devin Review found 2 findings. Devin automatically fixed all 2 findings.
Fixed by Devin (2)
- English-only matches in Constructive search — Removed the forced-English matches factory and added French-request regressions on ConstructivePreset.
- Undefined adapter option discards preset language — An undefined adapter tsConfig no longer overrides the explicit preset config; added tests for the adapter, unified and matches paths.
Summary
Full-text search always parsed queries with English stemming, even for a French request, so
chevauxnever matched a French-indexedchevalrow.graphile-search's tsvector adapter, and the unified search andFullText.matchespaths that use it, now choose the query config in this order:The mapping is a fixed allowlist, and the config is passed as a bound parameter, so no request input is ever string-built into SQL.
graphile-settings' constructive preset no longer forcesenglish, which would otherwise always win.Tests cover the plugin (French matches stems, English default unchanged, unknown code falls back, explicit config wins) and cached-handler HTTP
Accept-Language. With the DB fix (constructive-db PR), integrationrealtime-i18n-searchIS197 passes (run 44904093702).Implemented in session Build real-time end-to-end tests in integration repo
Review with Devin · Open in Devin Desktop
Summary by CodeRabbit
FullText.matchesnow use language preferences from HTTP and WebSocket requests for language-aware stemming.