LindormSearch support custom dictionaries, which are implemented by updating configuration
sets. You can update the dictionary files and stopword lists based on your requirements.
This topic describes how to configure custom dictionaries.
Limits
Only the IK analyzer is supported. You can specify the analyzer by creating a search
index. For more information, see CREATE SEARCH INDEX.
Procedure
- Run the following command to go to the lindorm-search-cli/bin directory:
cd lindorm-search-cli/bin
- Run the following command to view the list of configuration sets:
./search-cli zk ls /configs
- Run the following command to download the configuration set you want to modify to
the current directory. After the command is run, a directory named conf is created in the current directory.
./search-cli zk downconfig -d . -n <configuration set name>
The following command provides an example on how to download a configuration set:
./search-cli zk downconfig -d . -n default.myTable.myIdx
- Run the following command to go to the conf directory:
- If the extra_main.dic file does not exist in the conf directory, run the following command to create a dictionary file named extra_main.dlc:
- Run the following command to edit the dictionary file:
vi extra_main.dic
Each line in the dictionary file can contain only one word. The following example
shows how to edit the dictionary file:
Guide
Product
Engine
- Run the following command to edit the stopword list file. By default, the name of
the stopword list file is extra_stopword.dic.
- Run the following command to return to the bin directory.
- Run the following command to upload the configuration set to the server:
./search-cli zk upconfig -d conf -n default.myTable.myIdx
- Run the following command to make the configuration set take effect:
./search-cli reload_collection -c default.myTable.myIdx