Skip to content
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

建议增加索引避免关键字功能 #6564

Closed
4 tasks done
duckeaty opened this issue Jun 1, 2024 · 5 comments
Closed
4 tasks done

建议增加索引避免关键字功能 #6564

duckeaty opened this issue Jun 1, 2024 · 5 comments
Labels
enhancement New feature or request stale No activity for more than 30 days

Comments

@duckeaty
Copy link

duckeaty commented Jun 1, 2024

Please make sure of the following things

  • I have read the documentation.
  • I'm sure there are no duplicate issues or discussions.
  • I'm sure this feature is not implemented.
  • I'm sure it's a reasonable and popular requirement.

Description of the feature / 需求描述

在群晖上挂载本地盘发现会出现@eadir,设置为隐藏后任然能搜索出来。能不能增加一个关键字框,对期内的关键字避免索引,可以在数据库增加触发器来完成。

Suggested solution / 实现思路

以屏闭@eadir为例:

基本不影响索引建立速度,其实测效果非常好,可以完全避免@eadir进索引,方法如下:
在数据库的x_search_nodes表增加触发器,在insert前对比关键字并阻止入库:

DELIMITER //
CREATE TRIGGER trg_before_insert_check
BEFORE INSERT ON x_search_nodes
FOR EACH ROW
BEGIN
    IF LOCATE('@eaDir', NEW.name) > 0 OR LOCATE('@eaDir', NEW.parent) > 0 THEN
        SIGNAL SQLSTATE '45000'
        SET MESSAGE_TEXT = 'Insert is not allowed for names or parent containing "@eaDir"';
    END IF;
END;
//
DELIMITER ;

Additional context / 附件

#6563alist在挂载群晖时显示@eadir及索引后搜索会出现@eadir的解决方法,附改MYSQL后搜索慢的解决方法

@duckeaty duckeaty added the enhancement New feature or request label Jun 1, 2024
Copy link

welcome bot commented Jun 1, 2024

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

Copy link

stale bot commented Jul 16, 2024

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.

@stale stale bot added the stale No activity for more than 30 days label Jul 16, 2024
@Ausli
Copy link

Ausli commented Jul 20, 2024

@stale stale bot removed the stale No activity for more than 30 days label Jul 20, 2024
Copy link

stale bot commented Sep 3, 2024

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.

@stale stale bot added the stale No activity for more than 30 days label Sep 3, 2024
Copy link

Hello @, this issue was closed due to inactive more than 52 days. You can reopen or recreate it if you think it should continue. Thank you for your contributions again.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale No activity for more than 30 days
Projects
None yet
Development

No branches or pull requests

2 participants