Skip to content

Do not bypass threshold for rerank when metadata filter is enabled - #14684

Merged
wangq8 merged 1 commit into
infiniflow:mainfrom
qinling0210:meta_similarity
May 8, 2026
Merged

wangq8 merged 1 commit into
infiniflow:mainfrom
qinling0210:meta_similarity

Conversation

@qinling0210

@qinling0210 qinling0210 commented May 8, 2026 •

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Do not bypass threshold for rerank when metadata filter is enabled

Type of change

  • Bug Fix (non-breaking change which fixes an issue)

@coderabbitai

coderabbitai Bot commented May 8, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d6823d55-b90b-44cd-b86d-bf5e0eff7032

📥 Commits

Reviewing files that changed from the base of the PR and between a32ebf3 and 725e8e4.

📒 Files selected for processing (1)
  • rag/nlp/search.py
💤 Files with no reviewable changes (1)
  • rag/nlp/search.py

📝 Walkthrough

Walkthrough

This change removes logic that explicitly disabled similarity threshold filtering for document retrieval when explicit document IDs were provided. The threshold filter now applies uniformly to all results regardless of whether they come from explicit ID selection.

Changes

Similarity Threshold Filtering for Explicit Document IDs

Layer / File(s) Summary
Threshold Filtering Behavior
rag/nlp/search.py
Removed the special case that set post_threshold = 0.0 when doc_ids were provided, so similarity threshold filtering now applies to all retrieval results including those from explicit document selection.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

A rabbit hops through filters bright,
No longer does the ID bypass might—
All documents must now justify their way,
By similarity's fair and equal say. 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly matches the main change: removing logic that bypassed similarity threshold filtering when doc_ids were provided.
Description check ✅ Passed The description follows the required template with both sections completed, though the problem statement is minimal and the context could be more detailed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

@qinling0210 qinling0210 self-assigned this May 8, 2026
@qinling0210 qinling0210 added the ci Continue Integration label May 8, 2026
@qinling0210
qinling0210 marked this pull request as ready for review May 8, 2026 09:16
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label May 8, 2026
@codecov

codecov Bot commented May 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.16%. Comparing base (a32ebf3) to head (725e8e4).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #14684   +/-   ##
=======================================
  Coverage   94.16%   94.16%           
=======================================
  Files          10       10           
  Lines         703      703           
  Branches      112      112           
=======================================
  Hits          662      662           
  Misses         25       25           
  Partials       16       16           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label May 8, 2026
@wangq8
wangq8 merged commit 4d6e8df into infiniflow:main May 8, 2026
1 check passed
pekar9781 pushed a commit to pekar9781/ragflow that referenced this pull request May 8, 2026
…nfiniflow#14684)

### What problem does this PR solve?

Do not bypass threshold for rerank when metadata filter is enabled

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
Ricardo-M-L pushed a commit to Ricardo-M-L/ragflow that referenced this pull request Aug 17, 2026
…nfiniflow#14684)

### What problem does this PR solve?

Do not bypass threshold for rerank when metadata filter is enabled

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants