Mattermost
  • About Mattermost
    • Mattermost Overview
      • The Mattermost platform
      • Collaboration workflows addressed by Mattermost
      • About the Mattermost open source project
    • Security Overview
      • Security Features
      • Security Updates
      • Security Policies
      • HIPAA compliance*
      • FINRA compliance*
    • Integrations Overview
      • Custom Apps
      • API
      • Plugins
      • Bots
      • Custom Slash Commands
      • Webhooks
      • Interactive Messages
      • CLI
      • Zapier
      • Source Code Customizations
    • Subscription Overview
      • General Frequently Asked Questions
    • Self-Hosted Subscriptions
      • Purchase a subscription
      • View subscription information
      • Add more users to a subscription
      • Renew a subscription
    • Cloud Subscriptions
      • Purchase a Cloud subscription
      • View subscription details
      • Add more users to your subscription
      • Renew your subscription
      • Frequently Asked Questions
    • Mattermost Deployments and Editions
      • Mattermost deployment options
      • Mattermost editions
      • Mattermost legacy Enterprise Editions
      • Packaging decisions
    • Corporate Directory Integration
      • Basic authentication
      • Security features for authentication
      • Active Directory/LDAP authentication
      • Authentication options outside of a private network
      • Future authentication methods
    • Certifications and Compliance Overview
      • GDPR Compliance
      • Accessibility Compliance
      • U.S. Trade Compliance
      • U.S. Export Compliance Overview
      • Frequently Asked Questions
    • Frequently Asked Questions (FAQ)
      • General Mattermost Questions
      • Community Questions
      • Notifications
      • Video, Audio, and Screen Sharing
      • Enterprise Questions
      • Mattermost Source Available License
      • Integrations
      • Use Cases
      • Product Questions
      • High Trust Questions
      • Design Decisions
      • Business Questions
      • Illicit Use
  • Deploy Mattermost
    • Get Started
      • Quick Install Guide
      • Run Mattermost via Docker
      • Administrator Tasks
      • Architecture
      • Implement Mattermost
      • Enterprise Roll Out Checklist
      • Welcome Email Template
    • Install Guides
      • Server Installation
      • Desktop/Mobile App Installation
    • Deployment Guide
      • Server Deployment
      • Desktop & Mobile App Deployment
    • 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
    • Troubleshooting Guides
      • General Troubleshooting
      • Troubleshooting Mobile Applications
      • MySQL Installation Troubleshooting
    • Changelogs
      • Mattermost Self-Hosted
      • Mattermost Legacy Self-Hosted
      • Mattermost Cloud
      • Mobile Apps
      • Desktop Apps
      • Deprecated Features
    • Other Resources
      • Install on Ubuntu 18.04 LTS
      • Install on RHEL 7
      • Deploy Mattermost on Bitnami
      • AWS Elastic Beanstalk Docker Setup
      • Install Mattermost Team Edition in GitLab Helm Chart
      • Open Source Components
  • Mattermost Administration
    • The Basics
      • Optimize Your Workspace
      • Mattermost Configuration Settings
      • Mattermost Deprecated Configuration Settings
      • Workspace Configuration for Cloud Deployments
      • Advanced Permissions
      • Guest Accounts
      • System Admin Roles
      • OpenID
      • Google SSO
      • Office 365 SSO
      • GitLab SSO
      • Multi-factor Authentication
      • Active Directory / LDAP
    • Cloud Admin
      • Workspace Setup and Configuration
      • Workspace Management
      • Workspace Compliance
    • Self-Hosted Admin
      • Self-Hosted Setup and Configuration
      • Self-Hosted Server Management
      • Self-Hosted Compliance
    • Other Resources
      • Converting OAuth 2.0 Service Providers to OpenID Connect
      • Generate a Support Packet
      • mmctl Command Line Tool
      • Migration Announcement Email Template
      • Advanced Permissions: Backend Infrastructure
      • Command Line Tools
      • Scripts
  • Welcome to Mattermost
    • Access your Mattermost workspace
      • Sign in to Mattermost
      • Keyboard Shortcuts
      • Log Out of Mattermost
    • Mattermost basics
      • Get Started with Mattermost Channels
      • Get Started with Mattermost Playbooks
      • Get Started with Mattermost Boards
      • Manage Custom Groups
      • About Teams
      • Team Settings
      • Team Keyboard Shortcuts
      • About User Roles
    • Customize your Mattermost experience
      • Manage your Mattermost Profile
      • Set Your Status and Availability
      • Customize Your Mattermost Theme
      • Customize Your Desktop App Experience
      • Manage Desktop App Server Connections
    • Interface changes in v6.0
      • What Changed in Mattermost v6.0?
  • Mattermost Channels
    • Channels, messages, and conversations
    • Work with channels
      • Channel Types
      • Create Channels
      • Channel Naming Conventions
      • Rename a Channel
      • Convert Public Channels to Private
      • Join and Leave Channels
      • Manage Channel Members
      • Find Channels
      • Navigate Between Channels
      • Mark Channels as Favorites
      • Customize Your Channel Sidebar
      • Archive and Unarchive Channels
      • Set Channel Preferences
      • Channels Settings
    • Work with messages
      • Send Messages
      • Reply to Messages
      • Organize Conversations
      • React to Messages using Emojis
      • Mention People
      • Mark Messages as Unread
      • Format Messages
      • Share Files in Messages
      • Share Links to Messages
      • Save and Pin Messages
      • Search for Messages
    • Keyboard accessibility
      • Keyboard Accessibility in Channels
      • Keyboard Shortcuts for Channels
      • Run Slash Commands
    • Extend Channels functionality
      • Extend Functionality with Integrations
  • Mattermost Playbooks
    • The Basics
      • Overview
      • Access Playbooks
      • Plan Playbooks
      • Run Playbooks
      • Notifications and Updates
      • Retrospectives
  • Mattermost Boards
    • The Basics
      • Overview
      • Enable Boards
      • Access Boards
      • Work With Boards
      • Work with Cards
      • Share Boards
      • Migrate to Boards
      • Templates
  • Mattermost for Developers
  • Get Help With Mattermost
  • Community Chat
Mattermost
  • Docs »
  • Mattermost Administration Guide »
  • Chinese, Japanese, and Korean Search
  • Search
    Edit

Chinese, Japanese, and Korean Search 

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 

数据库版本请参考: 配置要求 。 其中MySQL的ngram配置可以参考 Cannot search CJK contents 。

更多中文相关问题讨论请访问 中文讨论组 。

以Ubuntu 14.04 PostgreSQL 9.3 数据库 mattermost 为例。

编译scws 

wget -q -O - http://www.xunsearch.com/scws/down/scws-1.2.2.tar.bz2 | tar xjf -
cd scws-1.2.2
./configure
make install

编译zhparser 

sudo apt-get install --yes postgresql-server-dev-9.3 libpq-dev
git clone https://github.com/amutu/zhparser.git
SCWS_HOME=/usr/local make && make install

Note

通过 Docker 镜像(mattermost/mattermost-prod-db)应用数据库的用户,请按照下述方法安装依赖项。

# Alpine 通过 apk add 命令安装依赖项
apk add wget tar gcc git postgresql-dev

创建extension以及增加解析配置 

sudo -i -u postgres
psql mattermost -c 'CREATE EXTENSION zhparser'
psql mattermost -c 'CREATE TEXT SEARCH CONFIGURATION simple_zh_cfg (PARSER = zhparser);'
psql mattermost -c 'ALTER TEXT SEARCH CONFIGURATION simple_zh_cfg ADD MAPPING FOR n,v,a,i,e,l WITH simple;'

设置postgresql 

将 /etc/postgresql/9.3/main/postgresql.conf 中 default_text_search_config 的值更改为 simple_zh_cfg,然后重启postgresql: sudo service postgresql restart

调试 

可以打开 mattermost 的配置 config/config.json 中 SqlSettings 的设置 Trace: true,然后可以在mattermost的标准输出看到执行的SQL语句。

SELECT to_tsvector('simple_zh_cfg', '开始全面整修道路');
SELECT to_tsvector('simple_zh_cfg', '开始全面整修道路') @@ to_tsquery('simple_zh_cfg', '全面');
SELECT * FROM Posts WHERE Message @@ to_tsquery('simple_zh_cfg', '全面');

日本語 / 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 없이 재구성합니다.

Next Previous

© Copyright 2015-2022 Mattermost.

Built with Sphinx using a theme provided by Read the Docs.
  Options 
Contribute
Report a Problem
Edit on GitHub
×
We're hiring!
Mattermost Logo
  • Platform
    Channels Learn More
    Playbooks Learn More
    Boards Learn More
    • Product Overview
    • Integrations
    • Security
  • Solutions
    Solutions Overview Read More

    USE CASES

    • Secure Collaboration
    • DevOps
    • Workflow Orchestration
    • Incident Resolution
    • CI/CD
    • Test/QA
    • IT Service Desk
    • APM/NPM
    Solutions Overview »

    INDUSTRIES

    • Government
    • Financial Services
    • Media & Entertainment
    • Legal
    • Healthcare
  • Pricing
  • Developers
    Deploy Run Your Server Now
    Integrate Learn More
    Contribute Learn More
    • Blog
    • Resources
    • Community
    • Docs
    • API Reference
    • Release Notes
  • Customers
  • Login
    My Workspace Login
    My Account Login
    Apps Download
    Support Help Center
  • Free Trial
  • Contact Sales