-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
重构全文搜索 #2439
重构全文搜索 #2439
Conversation
- Add text index service to dde-file-manager services - Install text index dbus service file - Install user json config for text index service Log: init text index service
- Change target_include_directories visibility to PRIVATE - Add task manager integration for index operations - Implement core index service methods - Add proper signal connections for index operations - Replace placeholder methods with actual implementations Log:
- Add proper type registration for IndexTask::Type - Change task progress type from int to qint64 - Move indexStorePath to global namespace - Add SPDX license headers - Improve thread safety with std::atomic_bool - Add comprehensive logging - Fix include paths and CMake configuration - Add fulltext search source files to build Summary: This commit focuses on improving the robustness and maintainability of the text index service, particularly around type safety and thread handling. It also standardizes the codebase with proper licensing and logging while fixing various build-related issues. Log: index for full text
- Extract common directory traversal logic into traverseDirectoryCommon - Add isSupportedFile helper function for file type checking - Move directory traversal utilities to separate module - Improve path validation and directory filtering - Add visited directory tracking to prevent loops - Enhance error handling and cleanup in index operations - Clean up file path handling with QDir::cleanPath This commit significantly improves the robustness and maintainability of the text index service by refactoring the directory traversal logic. It introduces better separation of concerns, adds safeguards against directory loops, and improves path handling throughout the codebase. Log:
* replace FinallyUtil with ScopeGuard for RAII resource management * add ScopeGuard class to handle resource cleanup * use ScopeGuard for DIR* and Lucene reader/writer cleanup * ensure exception safety and proper resource release * remove dependency on dfm-base library Log: The commit improves code safety and reduces external dependencies while maintaining all existing functionality.
* replace atomic_bool with TaskState class for better state management * use QAtomicInteger for thread-safe state control * remove unnecessary mutex and use atomic operations * fix task stop response delay issue * optimize code structure and readability Log: The commit improves task control reliability and responsiveness while maintaining thread safety.
* add QT_DEBUG guard for verbose debug output * improve debug message format for file operations * optimize file traversal process * remove redundant debug output * improve code readability and maintainability Log: The commit improves debug output control and code readability while maintaining core functionality.
* fix task state transition logic to avoid infinite loop * ensure task stops after completion without auto-restart * add detailed debug logs with [TextIndex] prefix * ensure service auto-start before DBus connection * improve error handling and state transition logging Log: The commit fixes the task state management to properly handle task completion and avoid unnecessary task restarts.
- Add TextIndex DBus interface to search plugin - Add service activation check in TextIndexController - Fix task progress reporting and cleanup in TaskManager - Optimize index update process with better interruption handling Log: This commit implements the TextIndex DBus interface integration and improves the service activation mechanism for better reliability.
- Remove local index creation logic from FullTextSearcher - Add TextIndexClient integration for index operations - Implement async task handling with proper state management - Add service status checking and error handling - Clean up deprecated code and unused functions This change moves the full-text search index management from local implementation to the new DBus service, improving reliability and maintainability of the search functionality. Log:
- Remove TextIndex DBus service auto-activation config - Change service policy from OnDemand to Resident mode - Remove idle timeout and policy path configurations - Clean up related installation files This change ensures TextIndex service stays resident instead of being activated on-demand, which resolves service activation timing issues. Log:
- Add index status file to track last successful update time - Implement status file management for root directory tasks - Add status clearing on task failure or new root index - Add debug instructions for service debugging - Comment out invalid index deletion temporarily This change adds persistence to track indexing status, which helps maintain index consistency and enables better recovery from failures. Log: text index
Warning
|
- Add missing SPDX license headers to TextIndexClient files - Update 3rdparty dependency paths in dep5 file - Move fulltext and fsearch libraries to root 3rdparty directory - Fix copyright information formatting This change standardizes license headers and reorganizes 3rdparty dependency locations for better project structure. Log: License
Warning
|
deepin pr auto review###PATH:./deepin-file-manager-backend-utest/src/services/textindex/textindexadaptor.cpp #include "textindexadaptor.h" SERVICETEXTINDEX_USE_NAMESPACE TextIndexAdaptor::TextIndexAdaptor(TextIndexDBus *qq) TextIndexAdaptor::~TextIndexAdaptor() bool TextIndexAdaptor::CreateIndexTask(const QString &path) bool TextIndexAdaptor::UpdateIndexTask(const QString &path) bool TextIndexAdaptor::StopCurrentTask() bool TextIndexAdaptor::HasRunningTask() bool TextIndexAdaptor::IndexDatabaseExists() ###PATH:./deepin-file-manager-backend-utest/src/services/textindex/textindexadaptor.h #ifndef TEXTINDEXADAPTOR_H #include "service_textindex_global.h" SERVICETEXTINDEX_BEGIN_NAMESPACE public Q_SLOTS: private: SERVICETEXTINDEX_END_NAMESPACE #endif // TEXTINDEXADAPTOR_H |
"/run", // 运行时文件 | ||
|
||
// 特殊目录 | ||
"/root", // root用户目录 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
跳过root目录,管理员打开的文管就搜索不到了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok,下次恢复
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Johnson-zs, max-lvs The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
7a60b1b
into
linuxdeepin:develop/snipe-25
No description provided.