feat: enhance OCR search with highlighting and config options#279
feat: enhance OCR search with highlighting and config options#279deepin-bot[bot] merged 3 commits intolinuxdeepin:masterfrom
Conversation
|
[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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
1. Added highlighting support for OCR text search results 2. Implemented preview content length restriction for OCR results 3. Added new configuration options for OCR text search: - Maximum preview length - Highlighting enable/disable toggle - Full text retrieval enable/disable toggle 4. Updated command line interface and documentation for OCR search features 5. Removed deprecated comments about lack of highlighting support 6. Default max results changed to 0 (unlimited) from 100 7. Added highlightedContent field in OCR result API Log: Added OCR search result highlighting and preview features with configurable options Influence: 1. Test OCR search with highlighting enabled/disabled 2. Verify preview length restriction works as expected 3. Test full text retrieval vs metadata only modes 4. Check JSON and text output formats for highlighted content 5. Test various max-results values including 0 (unlimited) 6. Verify backward compatibility with existing OCR searches feat: 增强OCR搜索功能,支持高亮和配置选项 1. 为OCR文本搜索结果添加高亮支持 2. 实现OCR结果预览内容长度限制 3. 新增OCR文本搜索配置选项: - 最大预览长度 - 高亮显示开关 - 全文检索开关 4. 更新命令行接口和文档以支持OCR搜索特性 5. 移除关于不支持高亮的过时注释 6. 默认最大结果数从100改为0(无限制) 7. 在OCR结果API中添加highlightedContent字段 Log: 新增OCR搜索结果高亮和预览功能,支持配置选项 Influence: 1. 测试启用/禁用高亮时的OCR搜索 2. 验证预览长度限制是否正常工作 3. 测试全文检索与仅元数据模式 4. 检查高亮内容在JSON和文本输出格式中的显示 5. 测试各种max-results值,包括0(无限制) 6. 验证与现有OCR搜索功能的向后兼容性
1. Created new base classes TextSearchOptionsAPI and TextSearchResultAPI 2. Moved common functionality from ContentSearch and OcrTextSearch to base classes 3. Changed ContentOptionsAPI and OcrTextOptionsAPI to inherit from TextSearchOptionsAPI 4. Changed ContentResultAPI and OcrTextResultAPI to inherit from TextSearchResultAPI 5. Consolidated duplicate code for preview length, highlighting, file attributes and timestamps 6. Updated implementation files to reflect inheritance changes The changes introduce better code organization by: 1. Removing duplicate code across different search types 2. Creating a clear hierarchy for search API classes 3. Making it easier to maintain and extend common functionality 4. Following DRY (Don't Repeat Yourself) principle 5. Increasing default preview length from 50 to 200 characters All existing functionality remains the same, only the implementation structure changed. refactor: 重构文本搜索API结构 1. 创建新的基类TextSearchOptionsAPI和TextSearchResultAPI 2. 将ContentSearch和OcrTextSearch中的通用功能移至基类 3. 修改ContentOptionsAPI和OcrTextOptionsAPI继承自TextSearchOptionsAPI 4. 修改ContentResultAPI和OcrTextResultAPI继承自TextSearchResultAPI 5. 整合预览长度、高亮显示、文件属性和时间戳处理的重复代码 6. 更新实现文件以反映继承关系变化 这些改动通过以下方式改善了代码组织: 1. 消除了不同类型搜索间的重复代码 2. 为搜索API类创建了清晰的层次结构 3. 使得维护和扩展通用功能更加容易 4. 遵循DRY(不要重复自己)原则 5. 将默认预览长度从50字符增加到200字符 所有现有功能保持不变,仅改变了实现结构。
Moved test object creation function declarations to file scope for better organization Added TextSearchAPI test suite to the main test runner Previously only DfmSearch, SearchUtils and TimeRangeFilter tests were executed Now TextSearchAPI tests will also be run as part of the test suite This ensures comprehensive testing coverage for all search-related components The change maintains backward compatibility while extending the test coverage Influence: 1. Verify all existing tests still pass 2. Check TextSearchAPI tests are executed and report results correctly 3. Ensure test suite exits with correct status code 4. Confirm no memory leaks from test object creation/deletion test: 在测试运行器中添加 TextSearchAPI 测试 将测试对象创建函数声明移至文件作用域以便更好组织 在主要测试运行器中添加了 TextSearchAPI 测试套件 之前仅执行了 DfmSearch、SearchUtils 和 TimeRangeFilter 测试 现在 TextSearchAPI 测试也将作为测试套件的一部分运行 此变更确保了对所有搜索相关组件的全面测试覆盖 该变更在保持向后兼容的同时扩展了测试范围 Influence: 1. 验证所有现有测试仍能通过 2. 检查 TextSearchAPI 测试是否被执行并正确报告结果 3. 确保测试套件以正确的状态码退出 4. 确认测试对象创建/删除不会导致内存泄漏
deepin pr auto reviewGit Diff 代码审查报告总体评价这次提交引入了一个新的基类 详细审查1. 语法和逻辑1.1
|
|
/forcemerge |
|
This pr force merged! (status: blocked) |
features
Log: Added OCR search result highlighting and preview features with
configurable options
Influence:
feat: 增强OCR搜索功能,支持高亮和配置选项
Log: 新增OCR搜索结果高亮和预览功能,支持配置选项
Influence: