Skip to content

🐛(backend) fix scoped full-text search - #2590

Open
fch-aa wants to merge 1 commit into
suitenumerique:mainfrom
fch-aa:fix/scoped-full-text-search
Open

🐛(backend) fix scoped full-text search#2590
fch-aa wants to merge 1 commit into
suitenumerique:mainfrom
fch-aa:fix/scoped-full-text-search

Conversation

@fch-aa

@fch-aa fch-aa commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Fixes #2589

Purpose

Scoped full-text searches fail before reaching the search indexer, preventing
users from searching within a document and its subdocuments.

Proposal

  • Resolve the scoped document path before querying the search indexer
  • Add regression coverage for document-scoped full-text search

The full backend suite passes with 2,214 tests passed and 1 skipped. Ruff,
Pylint, and gitlint also pass.

External contributions

General requirements

CI requirements

  • I made sure that all existing tests are passing
  • I have signed off my commits with git commit --signoff (DCO compliance)
  • I have signed my commits with my SSH or GPG key (git commit -S)
  • My commit messages follow the required format: <gitmoji>(type) title description
  • I have added a changelog entry under ## [Unreleased] section (if noticeable change)

AI requirements

  • I used AI assistance to produce part or all of this contribution
  • I have read, reviewed, understood and can explain the code I am submitting
  • I can jump in a call or a chat to explain my work to a maintainer

Document-scoped indexer searches attempted to call a queryset method on a
Document instance and failed before reaching Find. Resolve the path from the
queryset and cover the scoped request.

Signed-off-by: fch-aa <21101725+fch-aa@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3fec602d-afff-4256-95a5-f8d9ed4e425e

📥 Commits

Reviewing files that changed from the base of the PR and between fb984ab and 7104221.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • src/backend/core/api/viewsets.py
  • src/backend/core/tests/documents/test_api_documents_search.py

Included review availability: Your plan includes up to 10 reviews per rolling hour; 9 remain after this review.


Walkthrough

The backend now retrieves the scoped document path through a queryset projection before running the indexer search. A regression test verifies successful document-scoped searches and the path passed to the indexer. The changelog records the fix.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: 🔵 Low · up to 71042

Scoped searches now resolve the document path before querying, but access control for the parent document and descendants should be explicitly confirmed to prevent unauthorized search results; the PR is otherwise mergeable with owner awareness.

Suggested reviewers: lunika

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the backend fix for scoped full-text search, which is the primary change.
Description check ✅ Passed The description directly explains the search failure, proposed fix, regression test, and validation results.
Linked Issues check ✅ Passed The implementation resolves the document path before indexer queries and adds coverage for document-scoped search, satisfying issue #2589.
Out of Scope Changes check ✅ Passed The changelog, backend fix, and regression test are directly related to the linked issue and PR objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@virgile-dev

Copy link
Copy Markdown
Collaborator

@fch-aa thanks for your PR!
The full text search feature is coupled to Find
Find still needs some work, so we are not yet running it in production.
On the Docs end we will probably needs some refactor and better documentation.
All this to say, I'm not sure we're ready to merge PRs on full-text search.
I'll let @lunika give more details if needed.

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.

🐛(Bug) scoped full-text search fails

2 participants