merge new-file-search#213
Conversation
- Added dfm6-search as a dependency in debian/control. - Updated CMakeLists.txt to find and link dfm6-search. - Refactored FileNameSearcher to utilize dfm6-search for file name indexing. - Removed outdated Anything interface and related methods to streamline search functionality. Log: enhance file searching capabilities with dfm6-search integration
- Added a debounce timer to optimize search performance by delaying the search execution based on input changes. - Introduced a new method `performSearch` to handle the actual search logic. - Updated `onSearchTextChanged` to manage pending search text and adjust debounce timing based on input length. - Enhanced the overall search flow by ensuring that unnecessary searches are minimized. Log: Improve search responsiveness and efficiency.
- Updated FileNameWorker to support boolean keyword queries for improved search accuracy. - Modified FileSearchUtils to parse and store boolean keywords from input. - Refactored search logic to handle both simple and boolean search types based on user input. Log: improve search capabilities by integrating boolean keyword support
- Updated the constant name from MAX_SEARCH_NUM_TOTAOL to MAX_SEARCH_NUM_TOTAL for clarity and consistency. Log: fix typo in constant definition to ensure proper functionality
fd leak due to SearchEngine crated Log: fix fd leak
- Added methods to create search options and queries for improved search accuracy. - Implemented configuration for file name options based on search type. - Refactored searchByDFMSearch to streamline the search process and handle results effectively. - Updated FileSearchUtils to support type keywords for enhanced search capabilities. Log: improve file name searching by integrating DFM search features
- Increased debounce timer interval from 100ms to 200ms for improved responsiveness. - Modified debounce delay logic to set a shorter delay of 50ms for longer input (5 characters or more) to enhance search performance. Log: optimize debounce mechanism for better search input handling
6.0.9.1 Log:
- Remove any references to 'anything' - Integrate with DFM search interface Log: improve AI searching by integrating DFM search features
- Deleted FSearch related source and header files to streamline the project. - Updated CMake configuration to remove references to FSearch. - Adjusted searcher implementation to focus on the new file name searcher. Log: clean up project by removing obsolete FSearch integration
- Introduced a new enum ProcessResult to handle search outcomes more effectively. - Updated processSearchResults method to process individual file results and return appropriate status. - Enhanced searchByDFMSearch to handle search result validation and termination conditions. - Increased maximum search results limit for improved performance. Log: improve search result handling and processing logic in FileNameQuery
Update version Log: update version
- Changed the assignment of info.keyword in FileSearchUtils::parseContent from a search helper method to directly using the content string. - This adjustment simplifies the keyword extraction process when JSON parsing fails. Log: streamline keyword handling in file search utility Bug: https://pms.uniontech.com/bug-view-313835.html
- Adjusted debounce timing based on the byte length of the search text for improved responsiveness. - Enhanced comments for clarity regarding the debounce delay adjustments. Log: improve search input handling by refining debounce mechanism
- Added support for "folder" type in TypeCond and EngineCond to allow for more comprehensive search conditions. - Updated logic in FileNameQuery to ensure proper handling of file types and extensions based on entity properties. Log: improve search functionality by expanding file type recognition Bug: https://pms.uniontech.com/bug-view-316609.html
- Replaced synchronous search execution with a callback-based approach to enhance responsiveness during file searches. - Introduced a termination flag to manage search result processing more effectively. - Streamlined the searchByDFMSearch method for better clarity and performance. Log: optimize search processing by implementing callback mechanism in FileNameQuery
as title Log:
as title Log:
6.0.10 Log:
|
[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关键摘要:
是否建议立即修改: 建议立即修改的原因是,删除这些文件和类可能会影响搜索功能,特别是文件搜索功能,这是用户最常用的功能之一。如果这些功能被删除或损坏,用户可能会遇到搜索结果不完整或无法搜索的问题。因此,建议立即恢复这些文件和类,并确保它们能够正常工作。 |
|
TAG Bot TAG: 6.0.10 |
Reviewer's GuideThis PR replaces the previous deepin-anything and fsearch-based file search with a unified dfm6-search integration, refactors FileNameWorker and FileNameSearcher to use SearchOptions/SearchQuery APIs, removes legacy traversal and DBus code, introduces debounce logic in QueryController, and updates configuration and build scripts accordingly. Sequence Diagram for QueryController Search DebouncingsequenceDiagram
actor User
participant QC as QueryController
participant QCP as QueryControllerPrivate
participant DT as QTimer (m_debounceTimer)
participant DGS as DaemonGrandSearchInterface
User->>QC: types search text (onSearchTextChanged)
activate QC
QC->>DT: stop()
QC->>QCP: m_pendingSearchText = new text
QC->>DT: start(debounceDelay)
deactivate QC
DT-->>QCP: timeout()
activate QCP
QCP->>QCP: performSearch()
QCP->>QCP: m_searchText = m_pendingSearchText
QCP->>QCP: m_pendingSearchText.clear()
QCP->>QCP: m_missionId = new UUID
QCP->>DGS: Search(m_missionId, m_searchText)
activate DGS
DGS-->>QCP: return status
deactivate DGS
QCP->>QCP: m_keepAliveTimer.start()
deactivate QCP
Class Diagram for FileNameSearcher ChangesclassDiagram
class FileNameSearcher {
+FileNameSearcher(QObject* parent)
+name() const QString
+isActive() const bool
+activate() bool
+createWorker() const ProxyWorker*
+action(const QString& action, const QString& item) bool
-supportParallelSearch() const bool (removed)
}
FileNameSearcher ..> FileNameWorker : creates
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @Johnson-zs - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 3 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
|
||
| initAnything(); | ||
| // TODO (search): 搜索目录为user, by anything | ||
| m_searchPath = QDir::rootPath(); |
There was a problem hiding this comment.
issue: Update or remove outdated comment about search path
The comment still mentions user directories, but m_searchPath now uses QDir::rootPath(). Update it to match the code or adjust the path selection if needed.
| options.setSearchMethod(SearchMethod::Indexed); | ||
| return options; |
There was a problem hiding this comment.
suggestion (performance): Missing maxResults cap in semantic file-name queries
createSearchOptions doesn’t set maxResults; use the MAX_SEARCH_NUM_TOTAL limit to cap results.
| options.setSearchMethod(SearchMethod::Indexed); | |
| return options; | |
| options.setSearchMethod(SearchMethod::Indexed); | |
| options.setMaxResults(MAX_SEARCH_NUM_TOTAL); | |
| return options; |
| searcher/file/filesearchutils.h | ||
| searcher/file/filesearchutils.cpp | ||
| ) | ||
|
|
There was a problem hiding this comment.
suggestion: Consider adding comments to explain the revised file search logic.
Since the old fsearch vs. deepin-anything logic was replaced by dfm6-search and new ENABLE_SEMANTIC conditions, please add comments explaining the current file search process for maintainability.
| # ------------------------------------------------------------------------- | |
| # File Search Module | |
| # We now use the dfm6‐search engine as the core searcher. If ENABLE_SEMANTIC | |
| # is turned ON, semantic-aware indexing and querying components are built in; | |
| # otherwise only the basic path-based searcher is compiled. | |
| # | |
| # Legacy fsearch vs. deepin-anything logic has been replaced by this unified | |
| # dfm6‐search implementation for maintainability and extensibility. | |
| # ------------------------------------------------------------------------- | |
| searcher/extend/extendworker.cpp |
| } | ||
|
|
||
| bool FileNameWorkerPrivate::searchByDFMSearch() | ||
| { |
There was a problem hiding this comment.
issue (complexity): Consider keeping the new helper methods and the refactored search flow, as they improve code clarity and maintainability.
No action needed – the refactoring has actually collapsed a huge amount of bespoke logic into a single, focused searchByDFMSearch() call with a clear flow (via the helper methods). The small, single‐use helpers here improve readability and separation of concerns rather than introduce unnecessary indirection.
|
/forcemerge |
|
This pr force merged! (status: blocked) |
Summary by Sourcery
Unify file search implementation to use the DFM6 Search API and remove legacy deepin-anything/fsearch code, refactor file and semantic search workflows accordingly, add debounced front-end search requests, and update build configuration to depend on dfm6-search.
New Features:
Enhancements:
Build:
Chores: