Skip to content

enh: improve fulltext search#2577

Merged
benjaminfrueh merged 4 commits into
mainfrom
enh/fulltext-search-improvements
Jun 18, 2026
Merged

enh: improve fulltext search#2577
benjaminfrueh merged 4 commits into
mainfrom
enh/fulltext-search-improvements

Conversation

@benjaminfrueh

@benjaminfrueh benjaminfrueh commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Fixes #2559

📝 Summary

Collectives fulltext search improvements with a focus on sentence search, stem distance limiting and result ranking.

Changes

  • AND search for multi-token queries, only return documents containing all search terms
  • improved multi-token ranking using a match type scoring across all matched tokens
  • stem distance limit, stems too far from the original token are not indexed anymore, reducing noise
  • improve snippet preview, shows the exact phrase if found, otherwise the section containing the most matched tokens
  • prefix match always runs alongside exact match for the last token, to prevent short tokens from blocking results

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests
  • Documentation (README or documentation) has been updated or is not required

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI tools
  • The AI-generated content was reviewed, comprehended and tested by a human

@benjaminfrueh benjaminfrueh force-pushed the enh/fulltext-search-improvements branch from 6b82e9f to 2ddcd08 Compare June 16, 2026 15:22
Signed-off-by: Benjamin Frueh <benjamin.frueh@gmail.com>
@benjaminfrueh benjaminfrueh force-pushed the enh/fulltext-search-improvements branch from 2ddcd08 to 25c8d95 Compare June 16, 2026 19:09

@max-nextcloud max-nextcloud left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All in all looks good. Just some possible improvements. Not sure if for now or for later.

Comment thread lib/Search/FileSearch/FileSearcher.php
Comment thread lib/Search/FileSearch/FileSearcher.php Outdated
Comment thread lib/Search/FileSearch/FileSearcher.php Outdated
Signed-off-by: Benjamin Frueh <benjamin.frueh@gmail.com>
Comment thread lib/Search/FileSearch/FileSearcher.php
Comment thread lib/Search/FileSearch/FileSearcher.php
Comment thread lib/Search/FileSearch/FileSearcher.php Outdated
Signed-off-by: Benjamin Frueh <benjamin.frueh@gmail.com>

@max-nextcloud max-nextcloud left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally. Works great! Thanks a lot!

Signed-off-by: Benjamin Frueh <benjamin.frueh@gmail.com>
@benjaminfrueh benjaminfrueh force-pushed the enh/fulltext-search-improvements branch from 37e83e7 to 05f4a0c Compare June 18, 2026 10:34
@benjaminfrueh benjaminfrueh merged commit 7f33360 into main Jun 18, 2026
74 of 76 checks passed
@benjaminfrueh benjaminfrueh deleted the enh/fulltext-search-improvements branch June 18, 2026 12:36
@github-project-automation github-project-automation Bot moved this from 👀 In review to ☑️ Done in 📝 Productivity team Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ☑️ Done

Development

Successfully merging this pull request may close these issues.

Sentence search does not return anything useful

2 participants