Skip to content

fix: prevent partial matches for exact token searches#1937

Merged
NishadA05 merged 1 commit into
release-0.5.1from
fix-exact-knowledge-search-0.5.1
Jun 22, 2026
Merged

fix: prevent partial matches for exact token searches#1937
NishadA05 merged 1 commit into
release-0.5.1from
fix-exact-knowledge-search-0.5.1

Conversation

@NishadA05

Copy link
Copy Markdown
Collaborator

Fixes #1351

Summary

Fixes an issue where searching for an exact-looking token could return results even when that exact token was not in the knowledge base.

For example, searching ZX-49-RAG could return a document containing ZX-4819-RAG because the search matched similar token pieces.

This change keeps the existing search behavior, but adds a final check for code/token-like queries. If the exact query text is not found in the returned filename or chunk text, the result is removed.

Testing

Manually tested in Project Knowledge search:

  • Document contains ZX-4819-RAG

  • Search ZX-49-RAG

    • Result: no results returned
  • Search ZX-4819-RAG

    • Result: Project.code.for.QA.validation.is.ZX.docx returned

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: aaa5d80f-5794-4f65-9689-5dc775325ffc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: Too big: expected number to be <=900000 at "reviews.tools.github-checks.timeout_ms"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-exact-knowledge-search-0.5.1

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added backend 🔷 Issues related to backend services (OpenSearch, Langflow, APIs) bug 🔴 Something isn't working. labels Jun 22, 2026
@github-actions github-actions Bot added the lgtm label Jun 22, 2026
@NishadA05 NishadA05 merged commit 02b1d4a into release-0.5.1 Jun 22, 2026
9 of 10 checks passed
@github-actions github-actions Bot deleted the fix-exact-knowledge-search-0.5.1 branch June 22, 2026 23:21
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. lgtm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants