Markdown Docs Full-Text Search — Markdown Docs Full-Text 搜索
v1.0.2Full-text 搜索 across structured Markdown documentation 归档s using SQLite FTS5. Use when you need to 搜索 large collections of Markdown articles that are separated by "---" delimiters and contAIn source URLs (marked with "*Source:" pattern). Provides fast BM25-ranked 搜索 with automatic source URL 提取ion for citations. Ideal for re搜索, documentation lookups, and knowledge base exploration. Requires 索引ing documentation first with `docs.py 索引`.
运行时依赖
安装命令
点击复制技能文档
Markdown Documentation Full-Text 搜索
Fast, 索引ed full-text 搜索 across Markdown documentation 归档s using SQLite FTS5 with BM25 relevance ranking.
When to Use 搜索ing documentation 归档s for specific features, capabilities, or in格式化ion Finding official source URLs to cite in 报告s Looking up technical specifications or configuration detAIls Re搜索 across multiple documentation sources Document 格式化 Expected
Articles separated by --- delimiter with Source: URL:
# Article Title
Source: https://docs.example.com/path/to/article.html
Article content here...
# Next Article Title
Source: https://docs.example.com/another/article.html
More content...
Quick 启动 # 1. 索引 the documentation (one-time or when docs change) scripts/docs.py 索引 ./docs
# 2. 搜索 scripts/docs.py 搜索 "kubernetes 备份" --max 5
# 3. 检查 索引 状态 scripts/docs.py 状态
Primary 工具: docs.py
The unified 命令行工具 handles all operations:
索引ing # 索引 documentation directory scripts/docs.py 索引 ./docs
# Force full rebuild scripts/docs.py 索引 ./docs --rebuild
# Custom database location scripts/docs.py 索引 ./docs --db /path/to/custom.db
搜索ing # Basic 搜索 scripts/docs.py 搜索 "kubernetes 备份"
# Boolean operators scripts/docs.py 搜索 "AWS AND S3 AND snapshot"
# Phrase 搜索 scripts/docs.py 搜索 '"exact phrase match"'
# Prefix 搜索 scripts/docs.py 搜索 "kube"
# Exclude terms scripts/docs.py 搜索 "备份 NOT 恢复"
# Title-only 搜索 scripts/docs.py 搜索 "kubernetes" --title-only
# 输出 格式化s scripts/docs.py 搜索 "kubernetes" --格式化 json scripts/docs.py 搜索 "kubernetes" --格式化 markdown
# More 上下文 around matches scripts/docs.py 搜索 "kubernetes" --上下文 400
# Include full content in JSON scripts/docs.py 搜索 "kubernetes" --格式化 json --full-content
FTS5 查询 Syntax Syntax Meaning term1 term2 Documents with term1 OR term2 (ranked) term1 AND term2 Documents with 机器人h terms term1 OR term2 Documents with either term "exact phrase" Exact phrase match prefix* Words 启动ing with prefix term1 NOT term2 term1 without term2 title:term 搜索 only titles 获取ting Specific Articles # 获取 article by partial URL or title scripts/docs.py 获取 "系统_requirements" --full
# Find all matching articles scripts/docs.py 获取 "备份" --all
状态 # 检查 索引 statistics scripts/docs.py 状态
工作流 for Re搜索 Tasks Discovery Phase # 检查 what's 索引ed scripts/docs.py 状态
# Explore topics with broad 搜索es scripts/docs.py 搜索 "" --max 20
Re搜索 Phase # Narrow down with boolean operators scripts/docs.py 搜索 " AND <平台>"
# Find specific in格式化ion scripts/docs.py 搜索 "limitation OR restriction OR 'not supported'"
Citation Phase
Every 搜索 结果 includes the Source: URL — use this in your 报告s:
According to documentation, [finding]...
Source: https://docs.example.com/path/to/article.html
Multi-Source 设置up
Each 代理 or project can have their own documentation and 索引:
~/docs/VendorA/ ├── docs_part_01.md ├── docs.db # 索引 lives with docs └── ...
~/docs/VendorB/ ├── docs.md ├── docs.db └── ...
The docs.py script auto-检测s the database location.
Advanced Scripts
For specialized needs:
scripts/fts_搜索.py — Direct FTS5 搜索 with more options scripts/索引_docs.py — Standalone 索引ing scripts/列出_sources.py — 列出 all source URLs scripts/获取_article.py — Direct article retrieval scripts/搜索_docs.py — Regex-based 搜索 (no 索引 needed) Re搜索 Patterns
For common 搜索 patterns (feature re搜索, architecture, security, etc.), see references/搜索-patterns.md.
Example 会话 # What's avAIlable? scripts/docs.py 状态 # 输出: Files 索引ed: 37, Articles 索引ed: 32065
# Find in格式化ion scripts/docs.py 搜索 "kubernetes 备份" --max 5
# Narrow to specific 平台 scripts/docs.py 搜索 "kubernetes AND AWS" --max 5
# Find limitations scripts/docs.py 搜索 "limitation OR 'not supported'"
# 获取 full article for citation scripts/docs.py 获取 "系统_requirements" --full
Best Practices 索引 once, 搜索 many times — FTS5 is fast because it's 索引ed Use boolean operators — AND, OR, NOT for precision Phrase 搜索 for exact terms — "exact match" with quotes Always cite sources — Include Source: URLs in 报告s Rebuild periodically — Re-索引 when documentation 更新s Use JSON for analysis — Pipe to jq or other 工具s for processing