AlistGo / alist

🗂️A file list/WebDAV program that supports multiple storages, powered by Gin and Solidjs. / 一个支持多存储的文件列表/WebDAV程序,使用 Gin 和 Solidjs。
https://alist.nn.ci
GNU Affero General Public License v3.0
43.54k stars 5.64k forks source link

支持自定义搜索SQL查询 #5678

Closed mnixry closed 9 months ago

mnixry commented 10 months ago

Please make sure of the following things

Description of the feature / 需求描述

在MySQL和PostgreSQL中,存在多种插件/扩展程序来优化数据库的全文搜索能力,例如PGroongaMroongazhparser 等。

在大量AList用户存在CJK文本搜索的需求,而MySQL/PGSQL对CJK搜索支持较为薄弱的情况下,使用自定义的搜索引擎/扩展就显得尤为重要。通常来讲,使用这些搜索扩展需要对SQL查询进行不同程度的改动,而目前硬编码SQL查询的代码写法暂不支持这种需求。

Suggested solution / 实现思路

https://github.com/alist-org/alist/blob/83c22693306f36853d6c6c2b50f567d9b58cb834/internal/db/searchnode.go#L57-L74

从配置文件中读取SQL查询模板以代替使用硬编码的SQL查询来进行

Additional context / 附件

个人不是很熟悉AList项目的组织架构,如果有意见以及建议请多指教。

welcome[bot] commented 10 months ago

Thanks for opening your first issue here! Be sure to follow the issue template!

stale[bot] commented 9 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.