Skip to content

Develop/new file search#212

Merged
Johnson-zs merged 3 commits into
linuxdeepin:develop/new-file-searchfrom
Johnson-zs:develop/new-file-search
May 16, 2025
Merged

Develop/new file search#212
Johnson-zs merged 3 commits into
linuxdeepin:develop/new-file-searchfrom
Johnson-zs:develop/new-file-search

Conversation

@Johnson-zs
Copy link
Copy Markdown
Contributor

@Johnson-zs Johnson-zs commented May 16, 2025

Summary by Sourcery

Implement callback-based file name search with early termination, streamline file type configuration, and add "folder" type support to the DSL parser.

New Features:

  • Recognize "folder" type in DSL parser and map it to FOLDER_GROUP.

Enhancements:

  • Replace synchronous file search with a callback-based API for incremental result processing and early termination.
  • Refactor file type configuration to consolidate default grouping and conditional suffix handling.

- 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
@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

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 16, 2025

Reviewer's Guide

The PR refactors the filename search to use a streaming callback API with early termination, reorganizes default file type and extension configuration, and adds "folder" support in the DSL parser’s TypeCond and EngineCond logic.

File-Level Changes

Change Details Files
Refactor synchronous search to callback-based streaming with early termination
  • Replace searchSync and result loop with searchWithCallback invocation
  • Introduce a terminated flag and break out of loop when requested
  • Propagate termination status via callback return value
src/dde-grand-search-daemon/searcher/semantic/database/filenamequery.cpp
Restructure file type and extension configuration logic
  • Default to File group when no type-specific group is matched
  • Nest suffix check under default branch to conditionally set file extensions
src/dde-grand-search-daemon/searcher/semantic/database/filenamequery.cpp
Add support for "folder" type in DSL parser
  • Append FOLDER_GROUP in TypeCond constructor for "folder"
  • Handle "folder" in EngineCond’s type aggregation loop
src/dde-grand-search-daemon/searcher/semantic/dslparser/dslparser.cpp

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions
Copy link
Copy Markdown

TAG Bot

TAG: 6.0.9.3
EXISTED: no
DISTRIBUTION: unstable

@Johnson-zs Johnson-zs merged commit 1385b78 into linuxdeepin:develop/new-file-search May 16, 2025
7 checks passed
@lzwind
Copy link
Copy Markdown
Contributor

lzwind commented May 16, 2025

/topic cd-20250516

@deepin-ci-robot
Copy link
Copy Markdown

Add topic: cd-20250516 successed.

@lzwind
Copy link
Copy Markdown
Contributor

lzwind commented May 16, 2025

/integr-topic cd-20250516

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants