feat: add character count support for search results#356
Conversation
1. Added character count tracking for all search result types (Content/ OCR/Semantic) 2. Implemented PreviewResult::charCount() to expose the full content length 3. Added TextSearchResultAPI::setCharCount() and charCount() methods 4. Integrated character count into JSON and text output formats 5. Added preview output utilities for consistent formatting 6. Extended test coverage for character count functionality Log: Added character count display for search preview results Influence: 1. Test search preview results with verbose output to verify character counts 2. Check JSON output contains correct charCount fields 3. Verify text output formatting for character count display 4. Test boundary cases with empty content and various character sets 5. Confirm character count matches actual content length in different search types feat: 为搜索结果添加字符计数支持 1. 为所有搜索结果类型(内容/OCR/语义)添加字符计数跟踪 2. 实现PreviewResult::charCount()以暴露完整内容长度 3. 新增TextSearchResultAPI::setCharCount()和charCount()方法 4. 将字符计数集成到JSON和文本输出格式中 5. 添加预览输出工具函数以确保格式一致性 6. 扩展测试覆盖字符计数功能 Log: 为搜索结果预览添加字符计数显示功能 Influence: 1. 使用详细输出测试搜索结果预览,验证字符计数 2. 检查JSON输出是否包含正确的charCount字段 3. 验证文本输出的字符计数显示格式 4. 测试空内容和各种字符集的边界情况 5. 确认不同搜索类型下字符计数与实际内容长度匹配
There was a problem hiding this comment.
Sorry @Johnson-zs, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
[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 |
deepin pr auto review★ 总体评分:95分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 // src/dfm-search/dfm-search-client/preview_output_utils.cpp
void writePreviewResultText(QTextStream &out, const QString &path, const DFMSEARCH::PreviewResult &result)
{
out << path << "\n";
if (!result.content().isEmpty()) {
out << " " << result.content() << "\n";
} else {
out << " (no content)\n";
}
// 统一输出条件,与 TextOutput::printSearchResult 保持一致
if (result.charCount() > 0) {
out << " Char count: " << result.charCount() << "\n";
}
out << Qt::endl;
} |
|
/forcemerge |
|
This pr force merged! (status: blocked) |
OCR/Semantic)
length
Log: Added character count display for search preview results
Influence:
counts
search types
feat: 为搜索结果添加字符计数支持
Log: 为搜索结果预览添加字符计数显示功能
Influence: