Skip to content

feat: implement recent files search via DBus RecentManager#327

Merged
Johnson-zs merged 1 commit into
linuxdeepin:semantic-searchfrom
Johnson-zs:semantic-search
Jun 26, 2026
Merged

feat: implement recent files search via DBus RecentManager#327
Johnson-zs merged 1 commit into
linuxdeepin:semantic-searchfrom
Johnson-zs:semantic-search

Conversation

@Johnson-zs

Copy link
Copy Markdown
Contributor

Added support for searching recently-used files through DBus
RecentManager interface.
This involves a new SearchType::Recent enum value and a dedicated
RecentSearchEngine.
The feature is triggered by natural language patterns like "看过的" or
"打开过的".

Key changes:

  1. Added RecentSearchEngine and related DBus integration
  2. Implemented search strategy with keyword, extension, and time
    filtering
  3. Added new semantic rules for Chinese NLP to trigger recent searches
  4. Extended ParsedIntent to include recentOnly flag
  5. Updated semantic query building and execution logic to handle recent
    searches

Log: Added recent files search functionality via DBus RecentManager

Influence:

  1. Test Chinese NLP patterns like "打开过的文件" and "看过的pdf"
  2. Verify time constraints work with recent items
  3. Test keyword and extension filtering
  4. Verify bare verbs like "打开文件" don't trigger recent search
  5. Check that recentOnly properly suppresses index-based searches
  6. Test DBus error handling and fallback behavior

feat: 通过DBus RecentManager实现最近文件搜索功能

新增通过DBus RecentManager接口搜索最近使用文件的支持。
包括新的SearchType::Recent枚举值和专用的RecentSearchEngine。
该功能通过"看过的"、"打开过的"等自然语言模式触发。

主要变更:

  1. 新增RecentSearchEngine及相关DBus集成
  2. 实现带关键词、扩展名和时间过滤的搜索策略
  3. 为中文NLP添加新的语义规则以触发最近文件搜索
  4. 扩展ParsedIntent包含recentOnly标志
  5. 更新语义查询构建和执行逻辑以处理最近文件搜索

Log: 新增通过DBus RecentManager搜索最近文件的功能

影响范围:

  1. 测试中文NLP模式如"打开过的文件"和"看过的pdf"
  2. 验证时间约束条件与最近文件的交互
  3. 测试关键词和扩展名过滤功能
  4. 验证"打开文件"等简单动词不会误触发最近文件搜索
  5. 检查recentOnly正确抑制基于索引的搜索
  6. 测试DBus错误处理和回退行为

Added support for searching recently-used files through DBus
RecentManager interface.
This involves a new SearchType::Recent enum value and a dedicated
RecentSearchEngine.
The feature is triggered by natural language patterns like "看过的" or
"打开过的".

Key changes:
1. Added RecentSearchEngine and related DBus integration
2. Implemented search strategy with keyword, extension, and time
filtering
3. Added new semantic rules for Chinese NLP to trigger recent searches
4. Extended ParsedIntent to include recentOnly flag
5. Updated semantic query building and execution logic to handle recent
searches

Log: Added recent files search functionality via DBus RecentManager

Influence:
1. Test Chinese NLP patterns like "打开过的文件" and "看过的pdf"
2. Verify time constraints work with recent items
3. Test keyword and extension filtering
4. Verify bare verbs like "打开文件" don't trigger recent search
5. Check that recentOnly properly suppresses index-based searches
6. Test DBus error handling and fallback behavior

feat: 通过DBus RecentManager实现最近文件搜索功能

新增通过DBus RecentManager接口搜索最近使用文件的支持。
包括新的SearchType::Recent枚举值和专用的RecentSearchEngine。
该功能通过"看过的"、"打开过的"等自然语言模式触发。

主要变更:
1. 新增RecentSearchEngine及相关DBus集成
2. 实现带关键词、扩展名和时间过滤的搜索策略
3. 为中文NLP添加新的语义规则以触发最近文件搜索
4. 扩展ParsedIntent包含recentOnly标志
5. 更新语义查询构建和执行逻辑以处理最近文件搜索

Log: 新增通过DBus RecentManager搜索最近文件的功能

影响范围:
1. 测试中文NLP模式如"打开过的文件"和"看过的pdf"
2. 验证时间约束条件与最近文件的交互
3. 测试关键词和扩展名过滤功能
4. 验证"打开文件"等简单动词不会误触发最近文件搜索
5. 检查recentOnly正确抑制基于索引的搜索
6. 测试DBus错误处理和回退行为

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry @Johnson-zs, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Johnson-zs

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

★ 总体评分:97分

■ 【总体评价】

代码完整实现了基于DBus的最近使用文件搜索功能,架构清晰测试充分,但存在不必要的const_cast使用
逻辑正确且无安全漏洞,仅因代码质量中const_cast坏味道扣3分

■ 【详细分析】

  • 1.语法逻辑(正确)✓

整体逻辑链路完整,从语义规则匹配到DBus数据拉取、JSON解析、过滤管道到结果发射,流程清晰无死循环或空指针风险。fetchRecentItems中对JSON解析失败、DBus调用失败均有防御性返回空列表。filterByTimeRange中正确处理了start或end为无效QDateTime时不约束该侧边界的场景。search函数中通过m_cancelled原子变量和maxResults正确控制了提前终止条件。
潜在问题:无明显语法逻辑问题
建议:无需修改

  • 2.代码质量(良好)✓

代码注释详尽,中英文结合清晰表达了设计意图与数据流走向。测试用例覆盖了正向触发、五组同义词、时间字段强制、组合查询、反向排除、触发词消费等场景,

@Johnson-zs Johnson-zs merged commit 5b7f01a into linuxdeepin:semantic-search Jun 26, 2026
37 of 41 checks passed
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.

2 participants