Skip to content

fix: Uploaded document is not retrievable/searchable using its unique content.#1271

Merged
Wallgau merged 2 commits into
mainfrom
search-relevance-clean-r040
Mar 26, 2026
Merged

fix: Uploaded document is not retrievable/searchable using its unique content.#1271
Wallgau merged 2 commits into
mainfrom
search-relevance-clean-r040

Conversation

@Wallgau

@Wallgau Wallgau commented Mar 26, 2026

Copy link
Copy Markdown
Collaborator

issue: #1138

Improved Knowledge search relevance and partial-query handling by tuning frontend threshold defaults and backend hybrid query behavior.
Before:
Default scoreThreshold was effectively 0 when not provided, so low-relevance files were often included.
Short partial queries (like vita) often returned nothing.
Unique terms could still return unrelated files due to semantic spillover.
Returned total could reflect raw backend hits instead of post-filtered displayed results.
https://github.com/user-attachments/assets/47b4ff45-62a4-473d-b440-e1b82720be9e

Now:
Default scoreThreshold is 1.25 (frontend), with dynamic relaxation to 1.0 for short single-token queries (<=4 chars).
Backend keyword branch is stricter (operator: and, fuzziness: AUTO:4,7) and includes bool_prefix support for partials.
Added exact-text file preference: if query appears verbatim in specific files, results are narrowed to those files.
Fixed exact-file filtering robustness (only valid string filenames considered).
total now matches the actual filtered results shown (len(chunks)).
https://github.com/user-attachments/assets/7d073caf-c00d-41ee-aaa7-6a3735d86a91
merged in release-0.4.0, cheery-pick from: #1183

Olfa Maslah added 2 commits March 26, 2026 10:20
Improve hybrid search quality with a default score threshold, short-query threshold relaxation, prefix matching support, and exact-file preference for unique query text.

Made-with: Cursor
Use safer prefix fallback behavior for current index mappings and keep aggregations aligned with post-filtered exact file results.

Made-with: Cursor
@github-actions github-actions Bot added frontend 🟨 Issues related to the UI/UX backend 🔷 Issues related to backend services (OpenSearch, Langflow, APIs) labels Mar 26, 2026
@Wallgau Wallgau requested a review from lucaseduoli March 26, 2026 14:36
@github-actions github-actions Bot added the bug 🔴 Something isn't working. label Mar 26, 2026
@github-actions github-actions Bot added the lgtm label Mar 26, 2026
@Wallgau Wallgau merged commit 874d993 into main Mar 26, 2026
12 checks passed
@github-actions github-actions Bot deleted the search-relevance-clean-r040 branch March 26, 2026 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend 🔷 Issues related to backend services (OpenSearch, Langflow, APIs) bug 🔴 Something isn't working. frontend 🟨 Issues related to the UI/UX lgtm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants