Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Managing Word Dictionaries

Updated on 2024-12-02 GMT+08:00

You can configure custom word dictionaries to support word segmentation. This gives the search engine improved performance when searching by keywords such as company names and buzzwords from social media.

NOTE:
  • You cannot use the custom word dictionary function for clusters created before the function was launched .
  • Custom word dictionaries are used for Chinese word segmentation. They can also be used to segment English words based on special characters other than #&+-.@_

Context

Custom word dictionaries use the IK and synonym analyzers.

The IK analyzer has a main word dictionary and a stop word dictionary. The synonym analyzer has a synonym word dictionary. Before configuring a custom word dictionary, upload the prepared word dictionary file to OBS. For details, see Uploading a Word Dictionary File to OBS.

The IK analyzer uses the ik_max_word and ik_smart word segmentation policies. The synonym analyzer uses the ik_synonym word segmentation policy.

  • ik_max_word: splits the text at a fine granularity.
  • ik_smart: splits the text at a coarse granularity.

Prerequisites

To use the custom word dictionary, the account or IAM user used for logging in to the CSS management console must have both of the following permissions:
  • Tenant Administrator for project OBS in region Global service
  • Elasticsearch Administrator in the current region

Uploading a Word Dictionary File to OBS

Before configuring a custom word dictionary, upload the word dictionary file to an OBS bucket.

  1. Prepare the word dictionary file according to Table 1.
    Table 1 Word dictionary description

    Word Dictionary Type

    Description

    Requirement

    Main word dictionary

    Main words are words that users want to use as basis for performing word segmentation. A main word dictionary is a custom collection of such words.

    The word dictionary file must be a text file encoded using UTF-8 without BOM, with one word per row. The maximum size of a main word dictionary file is 100 MB. Letters must be in lowercase.

    Stop word dictionary

    Stop words are words that users wish to be ignored during word segmentation. The stop word dictionary is a custom collection of stop words.

    The word dictionary file must be a text file encoded using UTF-8 without BOM, with one word per row. The maximum size of a stop word dictionary file is 100 MB.

    Synonym dictionary

    Synonyms are words with the same or similar meanings. A synonym dictionary is a custom collection of synonyms.

    The word dictionary file must be a text file encoded using UTF-8 without BOM. Each row contains a group of synonyms separated by commas (,). The maximum size of a synonym dictionary file is 100 MB.

    Static main word dictionary

    The static main word dictionary is a collection of common main words preconfigured in CSS. To view the static main word dictionary, visit https://github.com/infinilabs/analysis-ik/blob/master/config/main.dic.

    The word dictionary file must be a text file encoded using UTF-8 without BOM, with one word per row. The maximum size of a static main word dictionary file is 100 MB.

    Static stop word dictionary

    The static stop word dictionary is a collection of common stop words preconfigured in CSS. To view the static stop word dictionary, visit https://github.com/infinilabs/analysis-ik/blob/master/config/stopword.dic.

    The word dictionary file must be a text file encoded using UTF-8 without BOM, with one word per row. The maximum size of a static stop word dictionary file is 100 MB.

    Extra main word dictionary

    The Extra main word dictionary is a collection of uncommon main words preconfigured in CSS. To access the Extra main word dictionary, visit https://github.com/infinilabs/analysis-ik/blob/master/config/extra_main.dic.

    The word dictionary file must be a text file encoded using UTF-8 without BOM, with one word per row. The maximum size of an Extra main word dictionary file is 100 MB.

    Extra stop word dictionary

    The Extra stop word dictionary is a collection of uncommon stop words preconfigured in CSS. To access the Extra stop word dictionary, visit https://github.com/infinilabs/analysis-ik/blob/master/config/extra_stopword.dic.

    The word dictionary file must be a text file encoded using UTF-8 without BOM, with one word per row. The maximum size of an Extra stop word dictionary file is 100 MB.

  2. Upload the word dictionary file to an OBS bucket. For details, see Object Storage Service User Guide. The OBS bucket to which data is uploaded must be in the same region as the cluster.

Managing Word Dictionaries

  1. Log in to the CSS management console.
  2. In the navigation pane, choose Clusters > Elasticsearch.
  3. On the Clusters page, click the name of the target cluster.
  4. Click the Word Dictionaries tab.
  5. On the Word Dictionaries page, configure custom word dictionaries for the cluster or modify preset ones.
    1. To configure custom word dictionaries, configure the required settings by referring to Table 2.
      Table 2 Configuring custom word dictionaries

      Parameter

      Description

      OBS Bucket

      Select the OBS location for storing the word dictionary file.

      You can click Create Bucket to create an OBS bucket. The new OBS bucket must be in the same region as the cluster, and Default Storage Class must be Standard or Infrequent Access.

      Main Word Dictionary

      The main word dictionary is a custom word dictionary. Its initial status is empty. By default, No Update is selected, meaning not to configure this word dictionary.

      • To add a custom main word dictionary, click Update and select a .txt word dictionary file.
      • If you do not want to use a certain word dictionary, click Do Not Use.

      Stop Word Dictionary

      Stop Word Dictionary is a custom word dictionary. Its initial status is empty. By default, No Update is selected, meaning not to configure this word dictionary.

      • To add a custom stop word dictionary, click Update and select a .txt word dictionary file.
      • If you do not want to use a certain word dictionary, click Do Not Use.

      Synonym Dictionary

      Synonym Dictionary is a custom word dictionary. Its initial status is empty. By default, No Update is selected, meaning not to configure this word dictionary.

      • To add a custom synonym dictionary, click Update and select a .txt word dictionary file.
      • If you do not want to use a certain word dictionary, click Do Not Use.
    2. To modify a preset word dictionary, toggle on Modify Preset Word Dictionary, and modify the word dictionary by referring to Table 3.
      NOTE:

      If the four preset word dictionaries (static & extra main word and stop word) are not displayed, the current cluster version does not support the deletion or modification of them. To use this function, you are advised to upgrade the cluster version, or create a new cluster and migrate data to it.

      Table 3 Configuring preset word dictionaries

      Parameter

      Description

      Static Main Word Dictionary

      Static Main Word Dictionary is a preset collection of common main words. By default, No Update is selected, meaning this word dictionary will be used.

      • To modify Static Main Word Dictionary, click Update and select a .txt word dictionary file.
      • If you do not want to use Static Main Word Dictionary, click Do Not Use.

      Static Stop Word Dictionary

      Static Stop Word Dictionary is a preset collection of common stop words. By default, No Update is selected, meaning this word dictionary will be used.

      • To modify Static Stop Word Dictionary, click Update and select a .txt word dictionary file.
      • If you do not want to use Static Stop Word Dictionary, click Do Not Use.

      Extra Main Word Dictionary

      Extra Main Word Dictionary is a preset collection of uncommon main words. By default, No Update is selected, meaning this word dictionary will be used.

      • To modify Extra Main Word Dictionary, click Update and select a .txt word dictionary file.
      • If you do not want to use Extra Main Word Dictionary, click Do Not Use.

      Extra Stop Word Dictionary

      Extra Stop Word Dictionary is a preset collection of uncommon stop words. By default, No Update is selected, meaning this word dictionary will be used.

      • To modify Extra Stop Word Dictionary, click Update and select a .txt word dictionary file.
      • If you do not want to use Extra Stop Word Dictionary, click Do Not Use.
  6. Click Save. In the dialog box that is displayed, click OK. The word dictionary information is displayed in the lower part of the page. The word dictionary status is Updating. In approximately 1 minute, the word dictionaries are configured, and Word Dictionary Status changes to Successful.
  7. The deletion or update of the four preset dictionaries (static main word, static stop word, extra main word, and extra stop word) requires a cluster restart to take effect. The update of other word dictionaries happens dynamically, and there is no need for cluster restart. For details about how to restart a cluster, see Restarting a Cluster.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback