Skip to content

feat(search): add useSearchCollection composable with FTS5 full-text search#3787

Draft
benjamincanac wants to merge 16 commits intomainfrom
feat/fts5-search
Draft

feat(search): add useSearchCollection composable with FTS5 full-text search#3787
benjamincanac wants to merge 16 commits intomainfrom
feat/fts5-search

Conversation

@benjamincanac
Copy link
Copy Markdown
Member

@benjamincanac benjamincanac commented May 6, 2026

🔗 Linked issue

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Adds useSearchCollection, a client-side composable that provides full-text search powered by SQLite FTS5. it builds an inverted index from content sections at runtime and queries it with BM25 ranking, prefix matching, and multi-column snippets. no external dependencies needed.

const { status, search } = useSearchCollection(['docs', 'blog'])

const results = await search('vue compo', {
  limit: 20,
  snippet: { columns: ['title', 'content'], around: 40 },
  weights: { title: 10, content: 5, heading: true }
})

Unified FTS5 table across multiple collections, lazy index building with immediate: false option, prefix matching on all terms (typing compo matches "composable"), configurable field restriction, BM25 column weights with heading-level boosting, camelCase title normalization for better ranking, and graceful handling of FTS5 syntax errors. queryCollectionSearchSections still available for Fuse.js/MiniSearch users who need typo tolerance.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

…t search

Co-Authored-By: Sébastien Chopin <atinux@gmail.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
content Ready Ready Preview, Comment May 8, 2026 1:43pm

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 6, 2026

npm i https://pkg.pr.new/@nuxt/content@3787

commit: 3a0140c

@socket-security
Copy link
Copy Markdown

socket-security Bot commented May 7, 2026

@socket-security
Copy link
Copy Markdown

socket-security Bot commented May 8, 2026

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn Critical
Critical CVE: Basic FTP has Path Traversal Vulnerability in its downloadToDir() method in npm basic-ftp

CVE: GHSA-5rq4-664w-9x2c Basic FTP has Path Traversal Vulnerability in its downloadToDir() method (CRITICAL)

Affected versions: < 5.2.0

Patched version: 5.2.0

From: pnpm-lock.yamlnpm/basic-ftp@5.1.0

ℹ Read more on: This package | This alert | What is a critical CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known critical CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/basic-ftp@5.1.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

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.

1 participant