Introduction
Dictionary configurations in advanced settings allow you to customize text analysis. If the results from a built-in analyzer do not meet your business requirements, you can configure a custom dictionary for that analyzer. This lets you customize the text analysis process to produce your desired results.
By default, the system provides two dictionary configuration versions. The system creates the version with the _offline_adv_v1 suffix, which includes eight types of analyzer dictionaries:
|
Dictionary type |
|
General Chinese analyzer.dict |
|
Industry - General E-commerce analyzer.dict |
|
Industry - General Game analyzer.dict |
|
Industry - Education analyzer.dict |
|
Industry - Entertainment Content analyzer.dict |
|
Industry - General English E-commerce.dict |
|
Industry - IT Content analyzer.dict |
|
Chinese - E-commerce analyzer.dict |
The advanced settings version with the _offline_adv_edit suffix is editable. After adding a new text analysis entry, click Publish. The system automatically generates a new advanced settings version with an incremental suffix. For example, the second published version will have the suffix _offline_adv_v2. You can add a description to each version to distinguish between them.
Add a custom intervention entry
Problematic case for text analysis: A doc that contains the text "ping-pong ball auction is over" cannot be retrieved by a search for "racket". This is because text analysis tokenizes the content into "ping-pong/ball/auction/over". The retrieval fails because the tokens from the search query do not exactly match the tokens from the doc.
Solution: Add a custom text analysis entry, such as "ping-pong paddle" => "ping-pong paddle", to resolve the text analysis bad case. The steps are as follows:
-
Go to Configuration Center > advanced settings. Find the version with the
_offline_adv_editsuffix and click Modify in the Actions column.This version is located in the version list on the dictionary configurations tab. After you finish modifying the version, return to this page and click Publish in the Actions column.
-
Find the analyzer type used by your index and click Modify.
-
You can add custom entries in two ways:
-
Enter a custom intervention entry, such as ping-pong paddle, in the UI text box and click OK. In the Dictionary Configuration File list on the left, select a target dictionary (such as Chinese-General Analyzer.dict). In the editing area of the Entry Management panel on the right, directly enter a custom intervention entry (such as
ping-pong paddle), and click OK to save. -
Upload a new dictionary file. After the file is uploaded, you can continue to edit its contents in the editor and then click OK.
Intervention dictionary entries use the format
Word Segment1 Segment2, such asbasketball shoes basketball shoes,artificial intelligence artificial intelligence, orunforgettable un forgettable. Each entry must be on a new line.Note: The file must be smaller than 5 MB and have a .dict or .txt extension.
Entries support the following two formats:
1) For an entry that should not be split further: Enter one entry per line. The file must be UTF-8 encoded, and the entry cannot contain spaces or tab characters (
\t). For example:Open Search opensearch2) For an entry that should be split into specific tokens: Enter the original word, followed by a tab character (
\t), and then the resulting tokens separated by spaces. The file must be UTF-8 encoded. For example:Open Search open search opensearch open search -
-
Publish the newly edited dictionary configuration version.
Add a description for the new version: In the description field of the publish dialog box, enter a description for the version and click OK. You cannot modify a version after it has been published.
After you publish, the system automatically generates a new dictionary configuration version.
The new version has a status of Unused and can be viewed in the version list on the dictionary configurations tab.
-
To apply the new configurations to your cluster, push the offline configurations and trigger reindexing.
Go to O&M Center > O&M Management and click Update Configurations. In the Instance Configuration Update panel, set Configuration Type to offline configurations, select the dictionary configurations version, and check the target cluster. For the reindexing option, select Push configurations and trigger reindexing, and then click OK.
In O&M Center > Change History, you can check the full reindexing progress under Data Source Changes:
The pipeline stages for a full reindexing task are init → trigger → scan → build → switch. A green checkmark appears next to each completed stage. The stage currently in progress shows a loading icon. Reindexing is successful when all stages are complete.
After reindexing completes, the new configurations take effect for online queries.
Delete a dictionary configuration version
You can delete a dictionary configuration version that is in the Unused state on the advanced settings > dictionary configurations page.
You can only View a dictionary configuration version that has a status of In Use. To delete the version, go to O&M Center > O&M Management > Update Configurations and select a different dictionary configuration version. Then, push the configurations and trigger reindexing. After reindexing is complete, you can delete the version when its status changes to Unused.
Notes
-
Each instance can have only one editable dictionary configuration version.
-
The version in service can only be viewed and cannot be deleted.
-
Advanced settings currently support dictionary configurations and query configurations.