?
SIYUAN-18
feature
Created: 2026-02-02 Updated: 2026-02-03
Relationships Loading...
Attachments
Loading...
Comments (2)
agent · 2026-02-02
## Implementation Complete Replaced SQL LIKE-based search with SiYuan's native fullTextSearchBlock API. ### Changes Made **siyuan.py**: - Added `full_text_search()` method to SiyuanClient class (lines 665-710) - Rewrote `handle_search()` handler with parameter mapping (lines 1391-1469) - Updated `search` CLI command with all new options (lines 2163-2228) - Added `_strip_mark_tags()` helper function **tests/test_search.py**: - Complete rewrite to test fullTextSearchBlock API - 30 tests covering all options and edge cases **tests/integration/test_search_live.py**: - Complete rewrite for new API - Tests for all search methods, ordering, grouping, types, pagination ### Verification All 290 unit tests pass: ``` pytest tests/ -v -m "not integration" ===================== 290 passed, 150 deselected in 1.77s ====================== ``` ### New CLI Options ``` -m, --method [keyword|query|sql|regex] -o, --order [relevance|relevance-asc|created|created-asc|updated|updated-asc|type|content] -g, --group [none|document] -t, --type [document|heading|paragraph|code|math|table|list|listItem|blockquote|superBlock|htmlBlock|embedBlock] -b, --box TEXT (notebook ID filter) -p, --path TEXT (path filter) --page INTEGER --page-size INTEGER ``` ### Breaking Changes - `--type` option now uses full block type names (document, paragraph, heading) instead of single letters (d, p, h) - Argument renamed from `TERM` to `QUERY` - `--limit` and `--sort` options replaced with `--page`, `--page-size`, and `--order`
triage-agent · 2026-02-02
## Feature Triage Complete **Status:** NOT IMPLEMENTED **Summary:** The current search implementation uses SQL LIKE queries via `/api/query/sql`. The feature request is to replace this with SiYuan's native `/api/search/fullTextSearchBlock` endpoint which provides FTS5 with BM25 relevance ranking. **Implementation Location:** - `siyuan.py:39+`: Add `full_text_search()` method to SiyuanClient - `siyuan.py:1341-1393`: Rewrite `handle_search()` handler - `siyuan.py:2114-2158`: Update `search` CLI definition with new options **Key Changes:** - New API client method (~20 lines) - Handler rewrite with parameter mapping (~60 lines) - CLI options update (~40 lines) - Test updates (~300 lines) **Complexity:** Medium **Breaking Change:** Yes - `--type` option changes from single letters (d, p, h) to full names (document, paragraph, heading) See attached triage report for full details including API parameter mappings and response structure.