Repository: linuxdeepin/dde-grand-search
Pull request #206: feat: enhance AI search functionality with DFM search integration
Author: login: Kakueeen
Created: 2025-05-08T08:59:04Z | Merged: 2025-05-08T10:51:49Z

- Remove any references to 'anything'
- Integrate with DFM search interface

Log: improve AI searching by integrating DFM search features

## Summary by Sourcery

Replace Anything search with DFM (Deepin File Manager) search functionality in the semantic search system

New Features:
- Integrate DFM search interface for file name searching

Enhancements:
- Improve file search capabilities by using DFM search engine
- Add more flexible file filtering options

Chores:
- Remove legacy Anything search interfaces and related code


Diff:
diff --git a/3rdparty/interfaces/anything_interface.cpp b/3rdparty/interfaces/anything_interface.cpp
deleted file mode 100644
index 3fe6199d..00000000
--- a/3rdparty/interfaces/anything_interface.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -m -p anything_interface /usr/share/dbus-1/interfaces/com.deepin.anything.xml
- *
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
- *
- * This is an auto-generated file.
- * This file may have been hand-edited. Look for HAND-EDIT comments
- * before re-generating it.
- */
-
-#include "anything_interface.h"
-
-/*
- * Implementation of interface class ComDeepinAnythingInterface
- */
-
-ComDeepinAnythingInterface::ComDeepinAnythingInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
-    : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
-{
-}
-
-ComDeepinAnythingInterface::~ComDeepinAnythingInterface()
-{
-}
-
-
-#include "anything_interface.moc"
diff --git a/3rdparty/interfaces/anything_interface.h b/3rdparty/interfaces/anything_interface.h
deleted file mode 100644
index e98778c8..00000000
--- a/3rdparty/interfaces/anything_interface.h
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * This file was generated by qdbusxml2cpp version 0.8
- * Command line was: qdbusxml2cpp -m -p anything_interface /usr/share/dbus-1/interfaces/com.deepin.anything.xml
- *
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
- *
- * This is an auto-generated file.
- * Do not edit! All changes made to it will be lost.
- */
-
-#ifndef ANYTHING_INTERFACE_H
-#define ANYTHING_INTERFACE_H
-
-#include <QtCore/QObject>
-#include <QtCore/QByteArray>
-#include <QtCore/QList>
-#include <QtCore/QMap>
-#include <QtCore/QString>
-#include <QtCore/QStringList>
-#include <QtCore/QVariant>
-#include <QtDBus/QtDBus>
-
-/*
- * Proxy class for interface com.deepin.anything
- */
-class ComDeepinAnythingInterface: public QDBusAbstractInterface
-{
-    Q_OBJECT
-public:
-    static inline const char *staticInterfaceName()
-    { return "com.deepin.anything"; }
-
-public:
-    ComDeepinAnythingInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr);
-
-    ~ComDeepinAnythingInterface();
-
-    Q_PROPERTY(bool autoIndexExternal READ autoIndexExternal WRITE setAutoIndexExternal)
-    inline bool autoIndexExternal() const
-    { return qvariant_cast< bool >(property("autoIndexExternal")); }
-    inline void setAutoIndexExternal(bool value)
-    { setProperty("autoIndexExternal", QVariant::fromValue(value)); }
-
-    Q_PROPERTY(bool autoIndexInternal READ autoIndexInternal WRITE setAutoIndexInternal)
-    inline bool autoIndexInternal() const
-    { return qvariant_cast< bool >(property("autoIndexInternal")); }
-    inline void setAutoIndexInternal(bool value)
-    { setProperty("autoIndexInternal", QVariant::fromValue(value)); }
-
-    Q_PROPERTY(int logLevel READ logLevel WRITE setLogLevel)
-    inline int logLevel() const
-    { return qvariant_cast< int >(property("logLevel")); }
-    inline void setLogLevel(int value)
-    { setProperty("logLevel", QVariant::fromValue(value)); }
-
-public Q_SLOTS: // METHODS
-    inline QDBusPendingReply<bool> addPath(const QString &path)
-    {
-        QList<QVariant> argumentList;
-        argumentList << QVariant::fromValue(path);
-        return asyncCallWithArgumentList(QStringLiteral("addPath"), argumentList);
-    }
-
-    inline QDBusPendingReply<QStringList> allPath()
-    {
-        QList<QVariant> argumentList;
-        return asyncCallWithArgumentList(QStringLiteral("allPath"), argumentList);
-    }
-
-    inline QDBusPendingReply<QString> cacheDir()
-    {
-        QList<QVariant> argumentList;
-        return asyncCallWithArgumentList(QStringLiteral("cacheDir"), argumentList);
-    }
-
-    inline QDBusPendingReply<bool> cancelBuild(const QString &path)
-    {
-        QList<QVariant> argumentList;
-        argumentList << QVariant::fromValue(path);
-        return asyncCallWithArgumentList(QStringLiteral("cancelBuild"), argumentList);
-    }
-
-    inline QDBusPendingReply<bool> hasLFT(const QString &path)
-    {
-        QList<QVariant> argumentList;
-        argumentList << QVariant::fromValue(path);
-        return asyncCallWithArgumentList(QStringLiteral("hasLFT"), argumentList);
-    }
-
-    inline QDBusPendingReply<QStringList> hasLFTSubdirectories(const QString &path)
-    {
-        QList<QVariant> argumentList;
-        argumentList << QVariant::fromValue(path);
-        return asyncCallWithArgumentList(QStringLiteral("hasLFTSubdirectories"), argumentList);
-    }
-
-    inline QDBusPendingReply<QStringList> insertFileToLFTBuf(const QByteArray &filePath)
-    {
-        QList<QVariant> argumentList;
-        argumentList << QVariant::fromValue(filePath);
-        return asyncCallWithArgumentList(QStringLiteral("insertFileToLFTBuf"), argumentList);
-    }
-
-    inline QDBusPendingReply<bool> lftBuinding(const QString &path)
-    {
-        QList<QVariant> argumentList;
-        argumentList << QVariant::fromValue(path);
-        return asyncCallWithArgumentList(QStringLiteral("lftBuinding"), argumentList);
-    }
-
-    inline QDBusPendingReply<QStringList, uint, uint> parallelsearch(const QString &path, uint startOffset, uint endOffset, const QString &keyword, const QStringList &rules)
-    {
-        QList<QVariant> argumentList;
-        argumentList << QVariant::fromValue(path) << QVariant::fromValue(startOffset) << QVariant::fromValue(endOffset) << QVariant::fromValue(keyword) << QVariant::fromValue(rules);
-        return asyncCallWithArgumentList(QStringLiteral("parallelsearch"), argumentList);
-    }
-    inline QDBusReply<QStringList> parallelsearch(const QString &path, uint startOffset, uint endOffset, const QString &keyword, const QStringList &rules, uint &startOffset_, uint &endOffset_)
-    {
-        QList<QVariant> argumentList;
-        argumentList << QVariant::fromValue(path) << QVariant::fromValue(startOffset) << QVariant::fromValue(endOffset) << QVariant::fromValue(keyword) << QVariant::fromValue(rules);
-        QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("parallelsearch"), argumentList);
-        if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 3) {
-            startOffset_ = qdbus_cast<uint>(reply.arguments().at(1));
-            endOffset_ = qdbus_cast<uint>(reply.arguments().at(2));
-        }
-        return reply;
-    }
-
-    inline QDBusPendingReply<QStringList> parallelsearch(const QString &path, const QString &keyword, const QStringList &rules)
-    {
-        QList<QVariant> argumentList;
-        argumentList << QVariant::fromValue(path) << QVariant::fromValue(keyword) << QVariant::fromValue(rules);
-        return asyncCallWithArgumentList(QStringLiteral("parallelsearch"), argumentList);
-    }
-
-    inline QDBusPendingReply<> quit()
-    {
-        QList<QVariant> argumentList;
-        return asyncCallWithArgumentList(QStringLiteral("quit"), argumentList);
-    }
-
-    inline QDBusPendingReply<QStringList> refresh(const QByteArray &serialUriFilter)
-    {
-        QList<QVariant> argumentList;
-        argumentList << QVariant::fromValue(serialUriFilter);
-        return asyncCallWithArgumentList(QStringLiteral("refresh"), argumentList);
-    }
-
-    inline QDBusPendingReply<QStringList> removeFileFromLFTBuf(const QByteArray &filePath)
-    {
-        QList<QVariant> argumentList;
-        argumentList << QVariant::fromValue(filePath);
-        return asyncCallWithArgumentList(QStringLiteral("removeFileFromLFTBuf"), argumentList);
-    }
-
-    inline QDBusPendingReply<bool> removePath(const QString &path)
-    {
-        QList<QVariant> argumentList;
-        argumentList << QVariant::fromValue(path);
-        return asyncCallWithArgumentList(QStringLiteral("removePath"), argumentList);
-    }
-
-    inline QDBusPendingReply<QStringList> renameFileOfLFTBuf(const QByteArray &fromFilePath, const QByteArray &toFilePath)
-    {
-        QList<QVariant> argumentList;
-        argumentList << QVariant::fromValue(fromFilePath) << QVariant::fromValue(toFilePath);
-        return asyncCallWithArgumentList(QStringLiteral("renameFileOfLFTBuf"), argumentList);
-    }
-
-    inline QDBusPendingReply<QStringList, uint, uint> search(int maxCount, qlonglong icase, uint startOffset, uint endOffset, const QString &path, const QString &keyword, bool useRegExp)
-    {
-        QList<QVariant> argumentList;
-        argumentList << QVariant::fromValue(maxCount) << QVariant::fromValue(icase) << QVariant::fromValue(startOffset) << QVariant::fromValue(endOffset) << QVariant::fromValue(path) << QVariant::fromValue(keyword) << QVariant::fromValue(useRegExp);
-        return asyncCallWithArgumentList(QStringLiteral("search"), argumentList);
-    }
-    inline QDBusReply<QStringList> search(int maxCount, qlonglong icase, uint startOffset, uint endOffset, const QString &path, const QString &keyword, bool useRegExp, uint &startOffset_, uint &endOffset_)
-    {
-        QList<QVariant> argumentList;
-        argumentList << QVariant::fromValue(maxCount) << QVariant::fromValue(icase) << QVariant::fromValue(startOffset) << QVariant::fromValue(endOffset) << QVariant::fromValue(path) << QVariant::fromValue(keyword) << QVariant::fromValue(useRegExp);
-        QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("search"), argumentList);
-        if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 3) {
-            startOffset_ = qdbus_cast<uint>(reply.arguments().at(1));
-            endOffset_ = qdbus_cast<uint>(reply.arguments().at(2));
-        }
-        return reply;
-    }
-
-    inline QDBusPendingReply<QStringList> search(const QString &path, const QString &keyword, bool useRegExp)
-    {
-        QList<QVariant> argumentList;
-        argumentList << QVariant::fromValue(path) << QVariant::fromValue(keyword) << QVariant::fromValue(useRegExp);
-        return asyncCallWithArgumentList(QStringLiteral("search"), argumentList);
-    }
-
-    inline QDBusPendingReply<QByteArray> setCodecNameForLocale(const QByteArray &name)
-    {
-        QList<QVariant> argumentList;
-        argumentList << QVariant::fromValue(name);
-        return asyncCallWithArgumentList(QStringLiteral("setCodecNameForLocale"), argumentList);
-    }
-
-    inline QDBusPendingReply<QStringList> sync(const QString &mountPoint)
-    {
-        QList<QVariant> argumentList;
-        argumentList << QVariant::fromValue(mountPoint);
-        return asyncCallWithArgumentList(QStringLiteral("sync"), argumentList);
-    }
-
-Q_SIGNALS: // SIGNALS
-    void addPathFinished(const QString &path, bool success);
-};
-
-namespace com {
-  namespace deepin {
-    typedef ::ComDeepinAnythingInterface anything;
-  }
-}
-#endif
diff --git a/src/dde-grand-search-daemon/CMakeLists.txt b/src/dde-grand-search-daemon/CMakeLists.txt
index 7257d523..46d5c718 100644
--- a/src/dde-grand-search-daemon/CMakeLists.txt
+++ b/src/dde-grand-search-daemon/CMakeLists.txt
@@ -134,8 +134,6 @@ else ()
         searcher/file/filenameworker_p.h
         searcher/file/filesearchutils.h
         searcher/file/filesearchutils.cpp
-        ${PROJECT_3RDPARTY_PATH}/interfaces/anything_interface.h
-        ${PROJECT_3RDPARTY_PATH}/interfaces/anything_interface.cpp
         ${SEMANTIC_FILES}
     )
 
diff --git a/src/dde-grand-search-daemon/searcher/file/filenameworker.cpp b/src/dde-grand-search-daemon/searcher/file/filenameworker.cpp
index 5d435a40..e113cd63 100644
--- a/src/dde-grand-search-daemon/searcher/file/filenameworker.cpp
+++ b/src/dde-grand-search-daemon/searcher/file/filenameworker.cpp
@@ -143,7 +143,7 @@ void FileNameWorkerPrivate::configureFileNameOptions(FileNameOptionsAPI &fileNam
     if (useTypeSearch) {
         fileNameOptions.setPinyinEnabled(true);
         fileNameOptions.setFileTypes(FileSearchUtils::buildDFMSearchFileTypes(m_searchInfo.groupList));
-        // TODO (search): add suffix filter
+        fileNameOptions.setFileExtensions(m_searchInfo.suffixList);
     } else if (query.type() == SearchQuery::Type::Boolean) {
         fileNameOptions.setPinyinEnabled(true);
     } else if (FileSearchUtils::isPinyin(keyword)) {
diff --git a/src/dde-grand-search-daemon/searcher/semantic/database/anythingquery.cpp b/src/dde-grand-search-daemon/searcher/semantic/database/anythingquery.cpp
deleted file mode 100644
index 2c3c92b4..00000000
--- a/src/dde-grand-search-daemon/searcher/semantic/database/anythingquery.cpp
+++ /dev/null
@@ -1,397 +0,0 @@
-// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
-//
-// SPDX-License-Identifier: GPL-3.0-or-later
-
-#include "anythingquery_p.h"
-#include "utils/specialtools.h"
-#include "global/searchhelper.h"
-#include "searcher/file/filesearchutils.h"
-#include "global/builtinsearch.h"
-#include "searcher/semantic/fileresultshandler.h"
-#include "global/commontools.h"
-
-using namespace GrandSearch;
-
-AnythingQueryPrivate::AnythingQueryPrivate(AnythingQuery *qq) : q(qq)
-{
-
-}
-
-AnythingQueryPrivate::~AnythingQueryPrivate()
-{
-    delete m_anythingInterface;
-    m_anythingInterface = nullptr;
-}
-
-void AnythingQueryPrivate::initAnything()
-{
-    QStringList homePaths = QStandardPaths::standardLocations(QStandardPaths::HomeLocation);
-    if (!homePaths.isEmpty())
-        m_searchPath = homePaths.first();
-
-    m_anythingInterface = new ComDeepinAnythingInterface("com.deepin.anything",
-                                                         "/com/deepin/anything",
-                                                         QDBusConnection::systemBus());
-    m_anythingInterface->setTimeout(1000);
-
-    // 自动索引内置磁盘
-    if (!m_anythingInterface->autoIndexInternal())
-        m_anythingInterface->setAutoIndexInternal(true);
-    return ;
-}
-
-bool AnythingQueryPrivate::searchUserPath(PushItemCallBack callBack, void *pdata)
-{
-    QFileInfoList fileInfoList = traverseDirAndFile(m_searchPath);
-
-    QHash<QString, QSet<QString>> filter;
-    MatchedItemMap items;
-
-    // 先对user目录下进行搜索
-    for (const SemanticEntity &entity : m_entity) {
-        QRegularExpression reg(getRegExp(entity), QRegularExpression::CaseInsensitiveOption);
-        for (const auto &info : fileInfoList) {
-            // 检查是否需要推送数据与中断
-            if (timeToPush()) {
-                auto it = std::move(items);
-                bool ret = callBack(it, pdata);
-                // 有数据放入，更新时间
-                if (!it.isEmpty())
-                    m_lastPush = m_time.elapsed();
-
-                // 中断
-                if (!ret)
-                    return false;
-            }
-
-            if (info.isDir())
-                m_searchDirList << info.absoluteFilePath();
-
-            // 检查文件名
-            if (!entity.partPath.isEmpty()) {
-                bool isMatch = info.canonicalFilePath().contains(entity.partPath);
-                //qDebug() << QString("(%1) vs (%2) isMatch(%3) vs require(%4)").arg(info.canonicalFilePath())
-                //            .arg(m_entity.partPath).arg(isMatch).arg(m_entity.isTrue);
-                if ((!entity.isContainPath && isMatch) || (entity.isContainPath && !isMatch)) {
-                    continue;
-                }
-            } else {
-                if (!info.fileName().contains(reg))
-                    continue;
-            }
-
-            // 检查时间
-            if (!SemanticHelper::isMatchTime(info.lastModified().toSecsSinceEpoch(), entity.times)
-                    && !SemanticHelper::isMatchTime(info.birthTime().toSecsSinceEpoch(), entity.times))
-                continue;
-
-            // 检查文件大小
-            if (!entity.fileCompType.isEmpty()) {
-                if (entity.fileCompType == ">") {
-                    if (!(info.size() > entity.fileSize)) {
-                        continue;
-                    }
-                } else if (entity.fileCompType == "<") {
-                    if (!(info.size() < entity.fileSize)) {
-                        continue;
-                    }
-                } else if (entity.fileCompType == "!=") {
-                    if (!(info.size() != entity.fileSize)) {
-                        continue;
-                    }
-                } else {
-                    if (!(info.size() == entity.fileSize)) {
-                        continue;
-                    }
-                }
-            }
-
-            auto absoluteFilePath = info.absoluteFilePath();
-
-            // 过滤文管设置的隐藏文件
-            if (SpecialTools::isHiddenFile(absoluteFilePath, filter, QDir::homePath()))
-                continue;
-
-            // 去除掉添加的data前缀
-            if (m_hasTransformed && absoluteFilePath.startsWith(m_searchPath))
-                absoluteFilePath.replace(m_searchPath, m_originalSearchPath);
-
-            m_count++;
-            if (m_handler) {
-                m_handler->appendTo(absoluteFilePath, items);
-                m_handler->setItemWeight(absoluteFilePath, m_handler->itemWeight(absoluteFilePath) + calcItemWeight(info.fileName()));
-                if (m_handler->isResultLimit() || m_count >= 100)
-                    break;
-            } else {
-                auto item = FileSearchUtils::packItem(absoluteFilePath, GRANDSEARCH_CLASS_GENERALFILE_SEMANTIC);
-                items[GRANDSEARCH_GROUP_FILE_INFERENCE].append(item);
-            }
-        }
-    }
-
-    return callBack(items, pdata);
-}
-
-bool AnythingQueryPrivate::searchByAnything(PushItemCallBack callBack, void *pdata)
-{
-    QStringList dirs = m_searchDirList;
-    MatchedItemMap items;
-
-    for (const SemanticEntity &entity : m_entity) {
-        QString regStr = getRegExp(entity);
-        qDebug() << "anything search reg" << regStr;
-
-        // 搜索
-        quint32 searchStartOffset = 0;
-        quint32 searchEndOffset = 0;
-
-
-        while (!dirs.isEmpty()) {
-            if (m_handler && m_handler->isResultLimit())
-                break;
-
-            QDBusPendingReply<QStringList, uint, uint> result;
-            {
-                QStringList rules;
-                rules << "0x02100"  // 搜索最大数量，100
-                      << "0x40."    // 过滤系统隐藏文件
-                      << "0x011"    // 支持正则表达式
-                      << "0x031";    // 忽略大小写
-                result = m_anythingInterface->parallelsearch(dirs.first(), searchStartOffset,
-                                                             searchEndOffset, regStr, rules);
-            }
-
-            // 直接判断errorType为NoError，需要先取值再判断
-            QStringList searchResults = result.argumentAt<0>();
-            if (result.error().type() != QDBusError::NoError) {
-                qWarning() << "deepin-anything search failed:"
-                           << QDBusError::errorString(result.error().type())
-                           << result.error().message();
-                searchStartOffset = searchEndOffset = 0;
-                dirs.removeAt(0);
-                continue;
-            }
-
-            searchStartOffset = result.argumentAt<1>();
-            searchEndOffset = result.argumentAt<2>();
-
-            // 当前目录已经搜索到了结尾
-            if (searchStartOffset >= searchEndOffset) {
-                searchStartOffset = searchEndOffset = 0;
-                dirs.removeAt(0);
-            }
-
-            for (auto &path : searchResults) {
-                // 检查是否需要推送数据与中断
-                if (timeToPush()) {
-                    auto it = std::move(items);
-                    bool ret = callBack(it, pdata);
-                    // 有数据放入，更新时间
-                    if (!it.isEmpty())
-                        m_lastPush = m_time.elapsed();
-
-                    // 中断
-                    if (!ret)
-                        return false;
-                }
-
-                // 去除掉添加的data前缀
-                if (m_hasTransformed && path.startsWith(m_searchPath))
-                    path.replace(m_searchPath, m_originalSearchPath);
-
-                if (!entity.partPath.isEmpty()) {
-                    bool isMatch = path.contains(entity.partPath);
-                    //qDebug() << QString("(%1) vs (%2) isMatch(%3) vs require(%4)").arg(path)
-                    //            .arg(m_entity.partPath).arg(isMatch).arg(m_entity.isTrue);
-                    if ((!entity.isContainPath && isMatch) || (entity.isContainPath && !isMatch)) {
-                        continue;
-                    }
-                }
-
-                // 检查时间（创建时间和修改时间的并集）
-                QFileInfo info(path);
-                if (!SemanticHelper::isMatchTime(info.lastModified().toSecsSinceEpoch(), entity.times)
-                        && !SemanticHelper::isMatchTime(info.birthTime().toSecsSinceEpoch(), entity.times))
-                    continue;
-
-                // 检查文件大小
-                if (!entity.fileCompType.isEmpty()) {
-                    if (entity.fileCompType == ">") {
-                        if (!(info.size() > entity.fileSize)) {
-                            continue;
-                        }
-                    } else if (entity.fileCompType == "<") {
-                        if (!(info.size() < entity.fileSize)) {
-                            continue;
-                        }
-                    } else if (entity.fileCompType == "!=") {
-                        if (!(info.size() != entity.fileSize)) {
-                            continue;
-                        }
-                    } else {
-                        if (!(info.size() == entity.fileSize)) {
-                            continue;
-                        }
-                    }
-                }
-
-                // 过滤文管设置的隐藏文件
-                QHash<QString, QSet<QString>> hiddenFilters;
-                if (SpecialTools::isHiddenFile(path, hiddenFilters, QDir::homePath()))
-                    continue;
-                m_count++;
-                if (m_handler) {
-                    m_handler->appendTo(path, items);
-                    m_handler->setItemWeight(path, m_handler->itemWeight(path) + calcItemWeight(info.fileName()));
-                    if (m_handler->isResultLimit() || m_count >= 100)
-                        break;
-                } else {
-                    auto item = FileSearchUtils::packItem(path, GRANDSEARCH_CLASS_GENERALFILE_SEMANTIC);
-                    items[GRANDSEARCH_GROUP_FILE_INFERENCE].append(item);
-                }
-            }
-        }
-    }
-
-    return callBack(items, pdata);
-}
-
-QFileInfoList AnythingQueryPrivate::traverseDirAndFile(const QString &path)
-{
-    QDir dir(path);
-    if (!dir.exists())
-        return {};
-
-    dir.setFilter(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot);
-    auto result = dir.entryInfoList();
-    // 排序
-    std::sort(result.begin(), result.end(), [](const QFileInfo &info1, const QFileInfo &info2) {
-        static QStringList sortList{"Desktop", "Music", "Downloads", "Documents", "Pictures", "Videos"};
-        int index1 = sortList.indexOf(info1.fileName());
-        int index2 = sortList.indexOf(info2.fileName());
-
-        if (index1 == -1)
-            return false;
-        else if (index2 == -1)
-            return true;
-
-        return index1 < index2;
-    });
-
-    return result;
-}
-
-QString AnythingQueryPrivate::getRegExp(const SemanticEntity &entity) const
-{
-    QString regStr;
-    // 文件名
-    if (!entity.keys.isEmpty())
-        regStr = QString(R"((%0).*)").arg(entity.keys.join('|'));
-    else
-        regStr = R"(.*)";
-
-    // 后缀名
-    QStringList suffixs = SemanticHelper::typeTosuffix(entity.types);
-    if (!suffixs.isEmpty()) {
-        regStr += QString(R"(\.(%0)$)").arg(suffixs.join('|'));
-    } else if (!entity.suffix.isEmpty()) {
-        if (entity.isContainType) {
-            regStr += QString(R"(\.(%0)$)").arg(entity.suffix);
-        } else {
-            regStr += QString(R"(\.[^(%0)]$)").arg(entity.suffix);
-        }
-    }
-
-    return regStr;
-}
-
-bool AnythingQueryPrivate::timeToPush() const
-{
-    return (m_time.elapsed() - m_lastPush) > 100;
-}
-
-double AnythingQueryPrivate::calcItemWeight(const QString &name)
-{
-    double w = 0;
-
-    QSet<QString> mergedKeys;
-    for (const SemanticEntity &e: m_entity) {
-        auto keys = e.keys;
-        for (const QString &key : keys)
-            mergedKeys.insert(key);
-    }
-
-    for ( const QString &key : mergedKeys) {
-        if (name.contains(key, Qt::CaseInsensitive))
-            w += 15;
-    }
-
-    return w;
-}
-
-AnythingQuery::AnythingQuery(QObject *parent)
-    : QObject(parent)
-    , d(new AnythingQueryPrivate(this))
-{
-    d->initAnything();
-}
-
-AnythingQuery::~AnythingQuery()
-{
-    delete d;
-    d = nullptr;
-}
-
-void AnythingQuery::run(void *ptr, PushItemCallBack callBack, void *pdata)
-{
-    Q_ASSERT(callBack);
-
-    AnythingQuery *self = static_cast<AnythingQuery *>(ptr);
-    Q_ASSERT(self);
-
-    auto d = self->d;
-    qDebug() << "query by deepin anything" << d->m_entity.size();
-    //检查home路径
-    bool useAnything = true;
-    if (!d->m_anythingInterface->hasLFT(d->m_searchPath)) {
-        // 有可能 anything 不支持/home目录，但是支持/data/home
-        const QString &tmpPath = CommonTools::bindPathTransform(d->m_searchPath, true);
-        if (!d->m_anythingInterface->hasLFT(tmpPath)) {
-            qWarning() << "Do not support quick search for " << tmpPath;
-            useAnything = false;
-        } else {
-            d->m_originalSearchPath = d->m_searchPath;
-            d->m_searchPath = tmpPath;
-            d->m_hasTransformed = true;
-        }
-    }
-    d->m_time.start();
-    // 搜索user目录下文件
-    if (!d->searchUserPath(callBack, pdata))
-        return; //中断
-
-    // 使用anything搜索
-    if (useAnything) {
-        if (!d->searchByAnything(callBack, pdata))
-            return; //中断
-    }
-
-    qDebug() << "deepin anything is finished spend:" << d->m_time.elapsed() << "found:" << d->m_count;;
-}
-
-void AnythingQuery::setEntity(const QList<SemanticEntity> &entity)
-{
-    d->m_entity.clear();
-
-    for (const SemanticEntity &e : entity) {
-        if (!e.album.isEmpty() || !e.author.isEmpty() || !e.duration.isEmpty()
-                || !e.resolution.isEmpty())
-            continue;
-        d->m_entity.append(e);
-    }
-}
-
-void AnythingQuery::setFileHandler(FileResultsHandler *handler)
-{
-    d->m_handler = handler;
-}
diff --git a/src/dde-grand-search-daemon/searcher/semantic/database/anythingquery_p.h b/src/dde-grand-search-daemon/searcher/semantic/database/anythingquery_p.h
deleted file mode 100644
index 262c85db..00000000
--- a/src/dde-grand-search-daemon/searcher/semantic/database/anythingquery_p.h
+++ /dev/null
@@ -1,41 +0,0 @@
-// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
-//
-// SPDX-License-Identifier: GPL-3.0-or-later
-
-#ifndef ANYTHINGQUERY_P_H
-#define ANYTHINGQUERY_P_H
-
-#include "anythingquery.h"
-#include "searcher/semantic/fileresultshandler.h"
-#include "interfaces/anything_interface.h"
-
-namespace GrandSearch {
-class AnythingQueryPrivate
-{
-public:
-    explicit AnythingQueryPrivate(AnythingQuery *qq);
-    ~AnythingQueryPrivate();
-    void initAnything();
-    bool searchUserPath(PushItemCallBack callBack, void *pdata);
-    bool searchByAnything(PushItemCallBack callBack, void *pdata);
-    QFileInfoList traverseDirAndFile(const QString &path);
-    QString getRegExp(const SemanticEntity &entity) const;
-    bool timeToPush() const;
-    double calcItemWeight(const QString &name);
-public:
-    ComDeepinAnythingInterface *m_anythingInterface = nullptr;
-    QList<SemanticEntity> m_entity;
-    QString m_searchPath;
-    QString m_originalSearchPath;
-    bool m_hasTransformed = false;
-
-    QStringList m_searchDirList;
-    FileResultsHandler *m_handler = nullptr;
-    QElapsedTimer m_time;
-    int m_lastPush = 0;
-    int m_count = 0;
-private:
-    AnythingQuery *q;
-};
-}
-#endif // ANYTHINGQUERY_P_H
diff --git a/src/dde-grand-search-daemon/searcher/semantic/database/filenamequery.cpp b/src/dde-grand-search-daemon/searcher/semantic/database/filenamequery.cpp
new file mode 100644
index 00000000..c48e151b
--- /dev/null
+++ b/src/dde-grand-search-daemon/searcher/semantic/database/filenamequery.cpp
@@ -0,0 +1,237 @@
+// SPDX-FileCopyrightText: 2025 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include "filenamequery.h"
+#include "filenamequery_p.h"
+#include "global/builtinsearch.h"
+
+using namespace GrandSearch;
+DFM_SEARCH_USE_NS
+
+#define MAX_SEARCH_NUM_TOTAL 10000
+
+FileNameQueryPrivate::FileNameQueryPrivate()
+{
+}
+
+void FileNameQueryPrivate::searchByDFMSearch(PushItemCallBack callBack, void *pdata)
+{
+    for (const SemanticEntity &entity : m_entity) {
+        if (m_handler && m_handler->isResultLimit())
+            break;
+
+        QObject holder;
+        SearchEngine *engine = SearchFactory::createEngine(SearchType::FileName, &holder);
+
+        // 创建搜索选项
+        SearchOptions options = createSearchOptions(entity);
+        // 创建搜索查询
+        SearchQuery query = createSearchQuery(entity);
+
+        // 配置文件名选项
+        FileNameOptionsAPI fileNameOptions(options);
+        configureFileNameOptions(fileNameOptions, query, entity);
+
+        // 设置搜索选项
+        engine->setSearchOptions(options);
+
+        // 执行搜索并处理结果
+        const SearchResultExpected &result = engine->searchSync(query);
+        if (!processSearchResults(result, entity, callBack, pdata))
+            return;
+    }
+
+    callBack(m_resultItems, pdata);
+}
+
+void FileNameQueryPrivate::configureFileNameOptions(FileNameOptionsAPI &fileNameOptions, const SearchQuery &query, const SemanticEntity &entity) const
+{
+    if (!entity.types.isEmpty()) {
+        QList<FileSearchUtils::Group> groupList;
+        std::transform(entity.types.begin(), entity.types.end(), std::back_inserter(groupList),
+                       [](const QString &group) {
+                           return FileSearchUtils::getGroupByGroupName(group);
+                       });
+        fileNameOptions.setFileTypes(FileSearchUtils::buildDFMSearchFileTypes(groupList));
+    } else if (!entity.suffix.isEmpty() && entity.isContainType) {
+        fileNameOptions.setFileExtensions({ entity.suffix });
+    }
+}
+
+bool FileNameQueryPrivate::processSearchResults(const SearchResultExpected &result,
+                                                const SemanticEntity &entity,
+                                                PushItemCallBack callBack,
+                                                void *pdata)
+{
+    if (!result.hasValue()) {
+        qWarning() << "DFMSearch failed for key: " << entity.keys << result.error().message();
+        return false;
+    }
+
+    for (const auto &file : result.value()) {
+        // 检查是否需要推送数据与中断
+        if (timeToPush()) {
+            auto it = std::move(m_resultItems);
+            bool ret = callBack(it, pdata);
+            // 有数据放入，更新时间
+            if (!it.isEmpty())
+                m_lastPush = m_time.elapsed();
+
+            // 中断
+            if (!ret)
+                return false;
+        }
+
+        const auto result = file.path();
+        if (!checkResultValid(result, entity))
+            continue;
+
+        m_count++;
+        if (m_handler) {
+            m_handler->appendTo(result, m_resultItems);
+            const auto fileName = result.mid(result.lastIndexOf('/') + 1);
+            m_handler->setItemWeight(result, m_handler->itemWeight(result) + calcItemWeight(fileName));
+            if (m_handler->isResultLimit() || m_count >= 100)
+                break;
+        } else {
+            auto item = FileSearchUtils::packItem(result, GRANDSEARCH_CLASS_GENERALFILE_SEMANTIC);
+            m_resultItems[GRANDSEARCH_GROUP_FILE_INFERENCE].append(item);
+        }
+    }
+
+    return true;
+}
+
+bool FileNameQueryPrivate::checkResultValid(const QString &result, const SemanticEntity &entity)
+{
+    if (!entity.partPath.isEmpty()) {
+        bool isMatch = result.contains(entity.partPath);
+        if ((!entity.isContainPath && isMatch) || (entity.isContainPath && !isMatch)) {
+            return false;
+        }
+    }
+
+    QFileInfo info(result);
+    if (!entity.isContainType && info.suffix() == entity.suffix)
+        return false;
+
+    if (!SemanticHelper::isMatchTime(info.lastModified().toSecsSinceEpoch(), entity.times)
+        && !SemanticHelper::isMatchTime(info.birthTime().toSecsSinceEpoch(), entity.times))
+        return false;
+
+    // 检查文件大小
+    if (!entity.fileCompType.isEmpty()) {
+        if (entity.fileCompType == ">") {
+            if (!(info.size() > entity.fileSize)) {
+                return false;
+            }
+        } else if (entity.fileCompType == "<") {
+            if (!(info.size() < entity.fileSize)) {
+                return false;
+            }
+        } else if (entity.fileCompType == "!=") {
+            if (!(info.size() != entity.fileSize)) {
+                return false;
+            }
+        } else {
+            if (!(info.size() == entity.fileSize)) {
+                return false;
+            }
+        }
+    }
+
+    return true;
+}
+
+SearchQuery FileNameQueryPrivate::createSearchQuery(const SemanticEntity &entity) const
+{
+    const auto &keyList = entity.keys;
+    SearchQuery query;
+
+    if (keyList.size() >= 2) {
+        query = SearchFactory::createQuery(keyList, SearchQuery::Type::Boolean);
+        query.setBooleanOperator(SearchQuery::BooleanOperator::OR);
+    } else if (keyList.size() == 1) {
+        query = SearchFactory::createQuery(keyList.first(), SearchQuery::Type::Simple);
+    } else {
+        query = SearchFactory::createQuery("", SearchQuery::Type::Simple);
+    }
+
+    return query;
+}
+
+SearchOptions FileNameQueryPrivate::createSearchOptions(const SemanticEntity &entity) const
+{
+    SearchOptions options;
+    options.setSearchPath(QDir::rootPath());
+    options.setSearchMethod(SearchMethod::Indexed);
+    options.setMaxResults(MAX_SEARCH_NUM_TOTAL);
+    return options;
+}
+
+bool FileNameQueryPrivate::timeToPush() const
+{
+    return (m_time.elapsed() - m_lastPush) > 100;
+}
+
+double FileNameQueryPrivate::calcItemWeight(const QString &name)
+{
+    double w = 0;
+
+    QSet<QString> mergedKeys;
+    for (const SemanticEntity &e : m_entity) {
+        auto keys = e.keys;
+        for (const QString &key : keys)
+            mergedKeys.insert(key);
+    }
+
+    for (const QString &key : mergedKeys) {
+        if (name.contains(key, Qt::CaseInsensitive))
+            w += 15;
+    }
+
+    return w;
+}
+
+FileNameQuery::FileNameQuery(QObject *parent)
+    : QObject(parent),
+      d(new FileNameQueryPrivate())
+{
+}
+
+FileNameQuery::~FileNameQuery()
+{
+    delete d;
+}
+
+void FileNameQuery::run(void *ptr, PushItemCallBack callBack, void *pdata)
+{
+    Q_ASSERT(callBack);
+
+    FileNameQuery *self = static_cast<FileNameQuery *>(ptr);
+    Q_ASSERT(self);
+
+    auto d = self->d;
+    qDebug() << "query by dfm search" << d->m_entity.size();
+    d->m_time.start();
+    d->searchByDFMSearch(callBack, pdata);
+    qDebug() << "deepin anything is finished spend:" << d->m_time.elapsed() << "found:" << d->m_count;
+}
+
+void FileNameQuery::setEntity(const QList<SemanticEntity> &entity)
+{
+    d->m_entity.clear();
+
+    for (const SemanticEntity &e : entity) {
+        if (!e.album.isEmpty() || !e.author.isEmpty() || !e.duration.isEmpty()
+            || !e.resolution.isEmpty())
+            continue;
+        d->m_entity.append(e);
+    }
+}
+
+void FileNameQuery::setFileHandler(FileResultsHandler *handler)
+{
+    d->m_handler = handler;
+}
diff --git a/src/dde-grand-search-daemon/searcher/semantic/database/anythingquery.h b/src/dde-grand-search-daemon/searcher/semantic/database/filenamequery.h
similarity index 53%
rename from src/dde-grand-search-daemon/searcher/semantic/database/anythingquery.h
rename to src/dde-grand-search-daemon/searcher/semantic/database/filenamequery.h
index 90ac8a2f..5f62a5da 100644
--- a/src/dde-grand-search-daemon/searcher/semantic/database/anythingquery.h
+++ b/src/dde-grand-search-daemon/searcher/semantic/database/filenamequery.h
@@ -1,9 +1,9 @@
-// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
+// SPDX-FileCopyrightText: 2025 UnionTech Software Technology Co., Ltd.
 //
 // SPDX-License-Identifier: GPL-3.0-or-later
 
-#ifndef ANYTHINGQUERY_H
-#define ANYTHINGQUERY_H
+#ifndef FILENAMEQUERY_H
+#define FILENAMEQUERY_H
 
 #include "searcher/semantic/semantichelper.h"
 
@@ -12,21 +12,21 @@
 namespace GrandSearch {
 
 class FileResultsHandler;
-class AnythingQueryPrivate;
-class AnythingQuery : public QObject
+class FileNameQueryPrivate;
+class FileNameQuery : public QObject
 {
     Q_OBJECT
-    friend class AnythingQueryPrivate;
+    friend class FileNameQueryPrivate;
 public:
-    explicit AnythingQuery(QObject *parent = nullptr);
-    ~AnythingQuery();
+    explicit FileNameQuery(QObject *parent = nullptr);
+    ~FileNameQuery();
     static void run(void *ptr, PushItemCallBack callBack, void *pdata);
     void setEntity(const QList<SemanticEntity> &entity);
     void setFileHandler(FileResultsHandler *handler);
 private:
-    AnythingQueryPrivate *d;
+    FileNameQueryPrivate *d;
 };
 
 }
 
-#endif // ANYTHINGQUERY_H
+#endif // FILENAMEQUERY_H
diff --git a/src/dde-grand-search-daemon/searcher/semantic/database/filenamequery_p.h b/src/dde-grand-search-daemon/searcher/semantic/database/filenamequery_p.h
new file mode 100644
index 00000000..1704292d
--- /dev/null
+++ b/src/dde-grand-search-daemon/searcher/semantic/database/filenamequery_p.h
@@ -0,0 +1,42 @@
+// SPDX-FileCopyrightText: 2025 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef FILENAMEQUERY_P_H
+#define FILENAMEQUERY_P_H
+
+#include "filenamequery.h"
+#include "searcher/semantic/fileresultshandler.h"
+
+#include <dfm-search/searchfactory.h>
+#include <dfm-search/filenamesearchapi.h>
+
+namespace GrandSearch {
+
+class FileNameQueryPrivate
+{
+public:
+    explicit FileNameQueryPrivate();
+    void searchByDFMSearch(PushItemCallBack callBack, void *pdata);
+
+    DFMSEARCH::SearchOptions createSearchOptions(const SemanticEntity &entity) const;
+    DFMSEARCH::SearchQuery createSearchQuery(const SemanticEntity &entity) const;
+    void configureFileNameOptions(DFMSEARCH::FileNameOptionsAPI &fileNameOptions, const DFMSEARCH::SearchQuery &query, const SemanticEntity &entity) const;
+    bool processSearchResults(const DFMSEARCH::SearchResultExpected &result, const SemanticEntity &entity, PushItemCallBack callBack, void *pdata);
+    bool checkResultValid(const QString &result, const SemanticEntity &entity);
+
+    bool timeToPush() const;
+    double calcItemWeight(const QString &name);
+
+public:
+    MatchedItemMap m_resultItems;
+    QList<SemanticEntity> m_entity;
+
+    FileResultsHandler *m_handler = nullptr;
+    QElapsedTimer m_time;
+    int m_lastPush = 0;
+    int m_count = 0;
+};
+}
+
+#endif   // FILENAMEQUERY_P_H
diff --git a/src/dde-grand-search-daemon/searcher/semantic/semanticworker.cpp b/src/dde-grand-search-daemon/searcher/semantic/semanticworker.cpp
index def7dd4e..a37ea338 100644
--- a/src/dde-grand-search-daemon/searcher/semantic/semanticworker.cpp
+++ b/src/dde-grand-search-daemon/searcher/semantic/semanticworker.cpp
@@ -9,7 +9,7 @@
 #include "semantichelper.h"
 #include "fileresultshandler.h"
 
-#include "database/anythingquery.h"
+#include "database/filenamequery.h"
 #include "database/fulltextquery.h"
 #include "database/featurequery.h"
 #include "database/vectorquery.h"
@@ -227,12 +227,12 @@ bool SemanticWorker::working(void *context)
     QList<SemanticWorkerPrivate::QueryFunction> querys;
     FileResultsHandler fileHandler;
 
-    AnythingQuery anything;
+    FileNameQuery fnQuery;
     if (canSemantic) {
-        SemanticWorkerPrivate::QueryFunction func = {&anything, &AnythingQuery::run, d};
+        SemanticWorkerPrivate::QueryFunction func = {&fnQuery, &FileNameQuery::run, d};
         querys.append(func);
-        anything.setEntity(entityList);
-        anything.setFileHandler(&fileHandler);
+        fnQuery.setEntity(entityList);
+        fnQuery.setFileHandler(&fileHandler);
     }
 
     FullTextQuery fuletext;


Reviews:
user: login: Clauszy
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-08T09:46:37Z
user: login: Kakueeen
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-08T10:41:37Z
user: login: Johnson-zs
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-05-08T10:49:10Z

Review comments:
diff_hunk: @@ -0,0 +1,237 @@
+// SPDX-FileCopyrightText: 2025 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include "filenamequery.h"
+#include "filenamequery_p.h"
+#include "global/builtinsearch.h"
+
+using namespace GrandSearch;
+DFM_SEARCH_USE_NS
+
+#define MAX_SEARCH_NUM_TOTAL 10000
+
+FileNameQueryPrivate::FileNameQueryPrivate()
+{
+}
+
+void FileNameQueryPrivate::searchByDFMSearch(PushItemCallBack callBack, void *pdata)
+{
+    for (const SemanticEntity &entity : m_entity) {
+        if (m_handler && m_handler->isResultLimit())
+            break;
+
+        QObject holder;
+        SearchEngine *engine = SearchFactory::createEngine(SearchType::FileName, &holder);
+
+        // 创建搜索选项
+        SearchOptions options = createSearchOptions(entity);
+        // 创建搜索查询
+        SearchQuery query = createSearchQuery(entity);
+
+        // 配置文件名选项
+        FileNameOptionsAPI fileNameOptions(options);
+        configureFileNameOptions(fileNameOptions, query, entity);
+
+        // 设置搜索选项
+        engine->setSearchOptions(options);
+
+        // 执行搜索并处理结果
+        const SearchResultExpected &result = engine->searchSync(query);
path: src/dde-grand-search-daemon/searcher/semantic/database/filenamequery.cpp
user: login: Clauszy
body: 支持中断吗？全局搜索的场景会很高频的出现中断，搜索，中断。如果不支持中断，连续输入可能会造成几个同时搜索，但仅有一个是有效的
created_at: 2025-05-08T09:46:30Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,237 @@
+// SPDX-FileCopyrightText: 2025 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include "filenamequery.h"
+#include "filenamequery_p.h"
+#include "global/builtinsearch.h"
+
+using namespace GrandSearch;
+DFM_SEARCH_USE_NS
+
+#define MAX_SEARCH_NUM_TOTAL 10000
+
+FileNameQueryPrivate::FileNameQueryPrivate()
+{
+}
+
+void FileNameQueryPrivate::searchByDFMSearch(PushItemCallBack callBack, void *pdata)
+{
+    for (const SemanticEntity &entity : m_entity) {
+        if (m_handler && m_handler->isResultLimit())
+            break;
+
+        QObject holder;
+        SearchEngine *engine = SearchFactory::createEngine(SearchType::FileName, &holder);
+
+        // 创建搜索选项
+        SearchOptions options = createSearchOptions(entity);
+        // 创建搜索查询
+        SearchQuery query = createSearchQuery(entity);
+
+        // 配置文件名选项
+        FileNameOptionsAPI fileNameOptions(options);
+        configureFileNameOptions(fileNameOptions, query, entity);
+
+        // 设置搜索选项
+        engine->setSearchOptions(options);
+
+        // 执行搜索并处理结果
+        const SearchResultExpected &result = engine->searchSync(query);
path: src/dde-grand-search-daemon/searcher/semantic/database/filenamequery.cpp
user: login: Kakueeen
body: 没有必要，搜索很快就能出结果
created_at: 2025-05-08T10:41:37Z
author_association: CONTRIBUTOR

PR comments:
user: login: sourcery-ai[bot]
created_at: 2025-05-08T09:00:58Z
body: <!-- Generated by sourcery-ai[bot]: start review_guide -->

## Reviewer's Guide

The AI search functionality was enhanced by replacing the 'anything' search module with DFM search integration. This involved removing all `AnythingQuery` components and introducing `FileNameQuery`. The new `FileNameQuery` class directly interfaces with the `dfm-search` library, creating search queries, configuring options, executing synchronous searches via the DFM engine, and processing the results. `SemanticWorker` and the build system were updated to reflect these changes.

### File-Level Changes

| Change | Details | Files |
| ------ | ------- | ----- |
| Replaced 'Anything' search module with DFM search library integration. | <ul><li>Implemented `FileNameQuery` class using the `dfm-search` library for file system queries.</li><li>Deleted the old `AnythingQuery` class and its associated `3rdparty` interface files.</li><li>Updated `SemanticWorker` to instantiate and use the new `FileNameQuery`.</li><li>Modified CMake build files to remove old components and add new ones.</li></ul> | `src/dde-grand-search-daemon/searcher/semantic/database/anythingquery.h`<br/>`src/dde-grand-search-daemon/searcher/semantic/database/filenamequery.h`<br/>`src/dde-grand-search-daemon/searcher/semantic/semanticworker.cpp`<br/>`src/dde-grand-search-daemon/CMakeLists.txt`<br/>`src/dde-grand-search-daemon/searcher/semantic/database/filenamequery.cpp`<br/>`src/dde-grand-search-daemon/searcher/semantic/database/filenamequery_p.h`<br/>`3rdparty/interfaces/anything_interface.cpp`<br/>`3rdparty/interfaces/anything_interface.h`<br/>`src/dde-grand-search-daemon/searcher/semantic/database/anythingquery.cpp`<br/>`src/dde-grand-search-daemon/searcher/semantic/database/anythingquery_p.h` |
| Enabled suffix-based file filtering in `FileNameWorker`. | <ul><li>Configured `FileNameOptionsAPI` to use `m_searchInfo.suffixList` for setting file extension filters.</li></ul> | `src/dde-grand-search-daemon/searcher/file/filenameworker.cpp` |

---

<details>
<summary>Tips and commands</summary>

#### 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](https://app.sourcery.ai) 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

- [Contact our support team](mailto:support@sourcery.ai) for questions or feedback.
- Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information.
- Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).

</details>

<!-- Generated by sourcery-ai[bot]: end review_guide -->
author_association: NONE
user: login: deepin-ci-robot
created_at: 2025-05-08T10:49:16Z
body: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by: *<a href="https://github.com/linuxdeepin/dde-grand-search/pull/206#pullrequestreview-2824728916" title="Approved">Johnson-zs</a>*, *<a href="https://github.com/linuxdeepin/dde-grand-search/pull/206#" title="Author self-approved">Kakueeen</a>*


The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=linuxdeepin%2Fdde-grand-search).

<details open>
Needs approval from an approver in each of these files:

- **[debian/deepin/OWNERS](https://github.com/linuxdeepin/dde-grand-search/blob/develop/new-file-search/debian/deepin/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->
author_association: NONE
user: login: Kakueeen
created_at: 2025-05-08T10:51:35Z
body: /forcemerge
author_association: CONTRIBUTOR
user: login: deepin-bot[bot]
created_at: 2025-05-08T10:51:48Z
body: This pr force merged! (status: unstable)
author_association: NONE