Mattermost
  • About Mattermost
    • Mattermost overview
    • Use cases
      • Secure command and control
      • Unified communication
        • Mattermost for Microsoft Teams
        • Mattermost Google Calendar integration
      • DevOps collaboration
      • Incident response collaboration
    • Security overview
    • Integrations overview
    • Subscription overview
    • Self-hosted subscriptions
    • Cloud subscriptions
    • Mattermost editions and plans
    • Corporate directory integration
    • Certifications and compliance overview
    • Frequently asked questions (FAQ)
      • General Mattermost questions
      • Community questions
      • Notifications
      • Video, audio, and screen sharing
      • Enterprise questions
      • License questions
      • Integrations
      • Use cases
      • Product questions
      • High trust questions
      • Design decisions
      • Business questions
      • Illicit use
  • Deploy Mattermost
    • Prepare your Mattermost database
    • Deploy on Ubuntu
    • Deploy using Docker
    • Deploy with a tarball
    • Deploy using Omnibus
    • Deploy using Kubernetes
    • Deploy on Red Hat
    • Set up an NGINX proxy
    • Set up TLS
    • Prepare for your Mattermost deployment
      • Software and hardware requirements
      • About the Mattermost Kubernetes Operator
      • Manage the Mattermost Kubernetes Operator
      • Administrator tasks
      • Architecture overview
      • Plan your Mattermost implementation
      • Enterprise roll out checklist
      • Welcome email template
    • Deployment guides
      • Server deployment
        • Deployment overview
        • Set up a socket-based Mattermost database
        • Image proxy
        • Backup and disaster recovery
        • Encryption options
        • Configure transport encryption
        • Bleve search
      • Desktop and mobile app deployment
        • Desktop app deployment guide
        • Desktop MSI installer and group policy installation guides (beta)
        • Desktop App custom dictionaries
        • Desktop managed resources
        • Using Mattermost’s pre-built mobile apps
        • Testing push notifications
        • Deploy Mattermost mobile apps
        • Mobile push notifications
        • Building and distributing your own custom Mattermost mobile apps
        • Deploying mobile apps using an EMM provider
        • AppConfig for EMM solutions with Mattermost Mobile Apps
        • Mobile VPN options
        • Mobile apps FAQ
        • Client-side data storage FAQ
    • Deploy Mattermost Apps
      • Settings
      • HTTP
      • AWS
      • Package Apps for AWS
      • OpenFaaS
    • Upgrade Mattermost
      • Prepare to upgrade Mattermost
      • Upgrade Mattermost Server
      • Enterprise install and upgrade
      • Install a license key
      • Release definitions
      • Important upgrade notes
      • Release lifecycle
      • Extended Support Release
      • Downgrade Mattermost Server
      • Version archive
    • Scale Mattermost
      • Scale for Enterprise
      • High availability cluster
      • Elasticsearch
      • Performance monitoring
      • Mattermost performance alerting guide
    • Deployment troubleshooting
      • General troubleshooting
      • Troubleshooting your high scale deployment
      • Troubleshooting mobile applications
      • PostgreSQL installation troubleshooting
      • MySQL installation troubleshooting
    • Changelogs
      • Mattermost changelog
      • Mattermost legacy self-hosted
      • Mattermost legacy Cloud
      • Mobile apps
      • Desktop app
      • Deprecated features
    • Additional server installation guides
      • Deploy Mattermost on Bitnami
      • AWS Elastic Beanstalk Docker setup
      • Install Mattermost Team Edition in GitLab Helm Chart
      • Open source components
  • Manage Mattermost
    • Get started
      • Optimize your workspace
      • Mattermost configuration settings
      • Self-hosted edition and license
      • Cloud subscription, billing, and account
      • Reporting configuration settings
      • User management configuration settings
      • Environment configuration settings
      • Site configuration settings
      • Authentication configuration settings
      • Plugins configuration settings
      • Integrations configuration settings
      • Compliance configuration settings
      • Experimental configuration settings
      • Deprecated configuration settings
      • Environment variables
      • Provisioning workflows
      • Multi-factor authentication
      • Active Directory/LDAP
      • GitLab SSO
      • OpenID SSO
      • Google SSO
      • Office 365 SSO
      • Advanced permissions
      • System admin roles
      • Manage team and channel members
      • Custom branding tools
      • eDiscovery
      • Compliance monitoring
      • Compliance export
      • Legal hold
      • Data retention tools
      • Custom terms of service
      • Notify Admin
      • AD/LDAP groups
      • Use AD/LDAP synchronized groups to manage team or private channel membership
      • Guest accounts
      • SAML Single Sign-On
        • Okta SAML Configuration
        • OneLogin SAML Configuration
        • Microsoft ADFS SAML Configuration for Windows Server 2012
        • Microsoft ADFS SAML Configuration for Windows Server 2016
        • Keycloak SAML Configuration
      • SAML Single-Sign-On: technical documentation
      • Shared channels
      • Statistics
      • In-product notices
      • User satisfaction surveys
      • Health check
      • Announcement banner
      • Bulk export tool
    • Cloud workspace management
      • Mattermost Cloud billing
      • Workspace usage
      • Workspace migration
      • Cloud data residency
      • Cloud IP Filtering
      • Cloud Bring Your Own Key (BYOK)
    • Self-hosted administration
      • Mattermost self-hosted billing
      • Mattermost error codes
      • Store configuration in the database
      • Bulk loading data
      • SMTP email setup
      • Email templates
      • Calls deployment
      • Configure CloudFront to host static assets
      • Use an outbound proxy
      • Migration guide
      • Migrate from Slack
      • Migration from MySQL to PostgreSQL
      • Chinese, Japanese, and Korean search
      • Customize Mattermost
      • Mattermost logging
      • JSON audit log schema
      • SSL client certificate setup
      • Certificate-based authentication
      • Manage telemetry
    • Other resources
      • Convert OAuth 2.0 providers to OpenID Connect
      • Generate a support packet
      • mmctl command line tool
      • Migration announcement email template
      • Advanced permissions infrastructure
      • Command line tools
  • Use Mattermost
    • Connect and collaborate
      • Access your Mattermost workspace
        • Install the desktop app
        • Install the iOS mobile app
        • Install the Android mobile app
        • Log out of Mattermost
      • Organize using teams
        • Team settings
        • Team keyboard shortcuts
      • Organize using custom user groups
      • Invite people
      • Learn about Mattermost roles
      • Collaborate within channels
        • Channel types
        • Channel naming conventions
        • Communicate a channel's focus and scope
        • Create channels
        • Rename channels
        • Convert public channels to private channels
        • Convert group messages to private channels
        • Join and leave channels
        • Make calls in Mattermost
        • Manage channel members
        • Browse channels
        • Navigate between channels
        • Mark channels as favorites
        • Mark channels as unread
        • Archive and unarchive channels
      • Communicate with messages and threads
        • Send messages
        • Reply to messages
        • React with emojis and GIFs
        • Organize conversations
        • Mark messages as unread
        • Forward messages
        • Share links to channels and messages
        • Save and pin messages
        • Set message reminders
        • Search for messages
        • Format messages
        • Set message priority
        • Mention people
        • Share files in messages
      • Keyboard shortcuts
        • Keyboard accessibility
        • Run slash commands
        • Built-in-slash-commands
      • Extend Mattermost with integrations
        • Collaborate within connected MS Teams
        • Collaborate within embedded MS Teams
        • Use the Mattermost Google Calendar plugin
    • Build repeatable processes
      • Learn about playbooks
      • Work with playbooks
      • Work with runs
      • Work with tasks
      • Work with notifications and updates
      • Work with metrics and goals
      • Share and collaborate
      • Interact with playbooks
    • Customize your preferences
      • Manage your notifications
      • Customize your Mattermost theme
      • Customize your channel sidebar
      • Manage your profile
      • Manage your security preferences
      • Set your status & availability
      • Manage your display options
      • Manage your sidebar options
      • Manage advanced options
      • Customize your desktop app experience
      • Connect to multiple workspaces
  • Develop with Mattermost
  • Get help with Mattermost
  • Join our community
  • Learn how we work
  • Contribute to this documentation
Mattermost
  • Docs »
  • Manage Mattermost »
  • Self-hosted administration »
  • Chinese, Japanese and Korean search
  • Search
    Edit

Chinese, Japanese and Korean search

plans-img Available on all plans

deployment-img self-hosted deployments

Enabling search for Chinese, Japanese and Korean (CJK) requires special configuration, since these languages do not contain spaces.

  • See database requirements documentation for how to set up search for these languages.

Contents

  • Chinese, Japanese and Korean search

    • 中文 / Chinese

      • 配置 SCWS

      • 配置 Zhparser

      • 创建 extension 并增加解析配置

      • 更新 PostgreSQL 配置

    • 日本語 / Japanese

      • 検索設定

      • ガイド

    • 한국어 / Korean

      • 검색을 위한 데이터베이스 설정

      • MySQL 해결 방법

Below is additional information on how to configure the database for different languages.

中文 / Chinese

尽管在 Mattermost 8.0 更新后,官方推荐为了更好的性能请使用 PostgreSQL 作为后端数据库。

但就目前而言,使用 MySQL 能够更容易的实现中文语言的全文搜索功能,在妥善配置 ngram 后,根据官方数据库构造重新生成索引即可达成。 具体的操作方式,可参考: Cannot search CJK contents。

有关 PostgreSQL 的配置方式,请参考以下流程:

配置 SCWS

# 取得 SCWS 代码
wget http://www.xunsearch.com/scws/down/scws-1.2.3.tar.bz2
# 解压缩
tar xvjf scws-1.2.3.tar.bz2
# 进入解压后的目录
cd scws-1.2.3
# 执行配置脚本、编译并安装
./configure --prefix=/usr/local/scws ; make ; make install

# 可选:检查文件是否存在
ls -al /usr/local/scws/lib/libscws.la
/usr/local/scws/bin/scws -h
# 可选:将词典安装在 /usr/local/scws/etc 中
cd /usr/local/scws/etc
wget http://www.xunsearch.com/scws/down/scws-dict-chs-gbk.tar.bz2
wget http://www.xunsearch.com/scws/down/scws-dict-chs-utf8.tar.bz2
tar xvjf scws-dict-chs-gbk.tar.bz2
tar xvjf scws-dict-chs-utf8.tar.bz2

配置 Zhparser

# 下载 Zhparser 源代码
git clone https://github.com/amutu/zhparser.git
# 进入下载后的目录
cd zhparser
# 编译并安装
SCWS_HOME=/usr/local/scws make && make install

Note

自 Mattermost 6.0 起,官方已不再使用 mattermost/mattermost-prod-db 作为数据库镜像,你可以直接使用安装在服务器上的 PostgreSQL 数据库,或者使用 PostgreSQL 官方的 Docker 镜像。

如果使用 Docker 镜像作为数据库,可以预先执行以下命令,安装依赖(请根据实际的 PostgreSQL 版本选择)。

# 更新本地缓存
apt update
# 配置 SCWS 时需要的依赖
apt install wget make gcc
# 配置 Zhparser 时需要的依赖
apt install git postgresql-server-dev-13

创建 extension 并增加解析配置

-- 创建 extension
CREATE EXTENSION zhparser
-- 创建 text search configuration
CREATE TEXT SEARCH CONFIGURATION simple_zh_cfg (PARSER = zhparser);
-- 配置 token mapping
ALTER TEXT SEARCH CONFIGURATION simple_zh_cfg ADD MAPPING FOR n,v,a,i,e,l WITH simple;

更新 PostgreSQL 配置

将 postgresql.conf 中的 default_text_search_config 的值更改为 simple_zh_cfg。

更改后,需要重启数据库方可生效。

Note

配置完成后,需根据 Mattermost 官方仓库中的 SQL 建表语句重新创建索引,方可正式启用中文语言的全文搜索功能。

未尽事宜,可以参考以下链接:

  • SCWS 官方文档

  • Zhparser 官方文档

  • Mattermost 建表语句

日本語 / Japanese

日本語翻訳の改善は大歓迎です。自由に変更していただいて結構です。

検索設定

Mattermost で日本語検索をするためにはデータベースの設定変更が必要です

  • MySQL

  • Postgres

日本語(CJK)検索設定のドキュメントの改善にご協力ください

ガイド

Qiita上で Mattermost のインストールおよび構成のガイドを提供しています。詳細については、こちら をご覧ください。

한국어 / Korean

이 문제에 대한 논의는 이 이슈 에서 시작되었습니다.

한국어 버전 이용 시 문제점을 발견하면 Localization 채널 또는 한국어 채널 에서 의견을 제시할 수 있습니다.

검색을 위한 데이터베이스 설정

PostgreSQL: PostgreSQL 데이터베이스에서는 따로 설정이 필요하지 않습니다.

MySQL: MySQL에서는 전문 검색(Full-text search) 기능에 제한이 있기 때문에 추가적인 작업이 필요합니다.

MySQL 해결 방법

  1. n-gram parser 를 이용하기 위해서는 MySQL의 버전이 5.7.6 이상이어야 합니다.

  2. MySQL의 구성 파일에서 n-gram의 최소 토큰 크기를 다음과 같이 설정합니다.

[mysqld]
ft_min_word_len = 2
innodb_ft_min_word_len = 2
  1. 데이터베이스를 재시작합니다. (이 과정은 반드시 필요합니다.)

  2. 일부 테이블의 전문 검색 색인을 다음과 같이 재구성합니다.

  • 게시물 검색을 위한 설정 ( 참조 )

DROP INDEX idx_posts_message_txt ON Posts;
CREATE FULLTEXT INDEX idx_posts_message_txt ON Posts (Message) WITH PARSER ngram;
  • 해시 태그 검색을 위한 설정 ( 참조 )

DROP INDEX idx_posts_hashtags_txt ON Posts;
CREATE FULLTEXT INDEX idx_posts_hashtags_txt ON Posts (Hashtags) WITH PARSER ngram;
  • 사용자 검색을 위한 설정

    Users.idx_users_txt_all 과 Users.idx_users_names_all 을 n-gram 없이 재구성합니다.

Previous Next

© Copyright 2015-2024 Mattermost.

Built with Sphinx using a theme provided by Read the Docs.
  Options 
Contribute
Report a Problem
Edit on GitHub
×
Inc. Recognizes Mattermost as a 2023 'Power Partner'!
Mattermost Logo
  • Platform

    Platform

    • Channels
    • Playbooks
    • Security
    • Integrations

    Benefits

    • Control of Collaboration
    • Risk & Error Reduction
    • Decision Optimization
    • Open Source

    Interoperability

    • MS Teams
    • Atlassian

    Featured Resource

    Our most popular content.

    Platform Overview Video »
  • Solutions

    Solutions

    • Use Cases
    • Industries
    • Customers
  • Pricing
  • Developers

    Developers

    • Deploy
    • Integrate
    • Contribute
    • Blog
    • Resources
    • Community
    • Academy
    • Docs
    • API Reference
    • Release Notes
  • Enterprise
  • Login

    Login

    • My Workspace
    • Admin Portal
    • Apps
    • Support
  • Get Started
  • Contact Sales