search_blocks
Search SiYuan notes for content blocks by keyword, block type, parent, or time range. Retrieve matching blocks with filtered results to locate specific notes efficiently.
Instructions
根据关键词、类型等多种条件在思源笔记中搜索内容块。
这是最核心和最灵活的查询工具。
适用场景: - 全局关键词检索。 - 按块类型和时间窗口缩小范围。
使用方法: - query: 使用 SQL LIKE 语义匹配 content。 - parent_id: 按直接父块 ID 过滤。 - block_type: 例如 p/h/l。
注意事项: - parent_id 仅匹配直接子块,不会递归后代。 - 返回 content 会做敏感信息打码处理。
Args: query (str): 在块内容中搜索的关键词。 parent_id (Optional[str]): 在哪个文档或父块下进行搜索。如果省略,则全局搜索。 block_type (Optional[str]): 限制块的类型,例如 'p' (段落), 'h' (标题), 'l' (列表)。 created_after (Optional[str]): 查找在此日期之后创建的块,格式为 'YYYYMMDDHHMMSS'。 updated_after (Optional[str]): 查找在此日期之后更新的块,格式为 'YYYYMMDDHHMMSS'。 limit (int): 返回结果的最大数量,默认为 20。
Returns: list: 包含块信息的字典列表。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| query | Yes | ||
| parent_id | No | ||
| block_type | No | ||
| created_after | No | ||
| updated_after | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |