Mattermost, Inc.

Aliyun postgresql can't config default_text_search_config , how to enable chinese search

我用的阿里云的postgresql没法修改default_text_search_config,
插件它倒是默认装了,
请问有办法支持中文搜索吗?

我可以手工运行 set default_text_search_config to ‘simple_zh_cfg’ ,
但是只对当前连接有效,
我不清楚怎么让mattermost每次连接都先执行下这句话。

I can’t change default_text_search_config using the postgresql in aliyun,
Plug-ins are installed by default,
Is there any way to support Chinese search?

I can manually run set default_text_search_config to ‘simple_zh_cfg’,
But only for the current connection,
I don’t know how to get mattermost to execute this sentence every time they connect.

Hi @TqLj, this documentation might help: https://docs.mattermost.com/install/i18n.html.

i read the documentation, my question is , I can’t change the default_text_search_config in config file , I only can run “set default_text_search_config to ‘simple_zh_cfg’” in every connect . how to execute this sentence every time when connect.

this seems change the default_text_search_config for role , but search still not work after restart mattermost

CREATE EXTENSION zhparser;
CREATE TEXT SEARCH CONFIGURATION simple_zh_cfg (PARSER = zhparser);
ALTER TEXT SEARCH CONFIGURATION simple_zh_cfg ADD MAPPING FOR n,v,a,i,e,l WITH simple;
set default_text_search_config to 'simple_zh_cfg';
ALTER ROLE mmuser IN DATABASE mmuser SET default_text_search_config TO 'simple_zh_cfg';

fixed , add this
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO mmuser

2 Likes