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.

Prerequisites

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

  1. Run the following command to go to the lindorm-search-cli/bin directory:
    cd lindorm-search-cli/bin
  2. Run the following command to view the list of configuration sets:
    ./search-cli zk ls /configs
  3. 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
  4. Run the following command to go to the conf directory:
    cd conf
  5. 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:
    touch extra_main.dic
  6. 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
  7. Run the following command to edit the stopword list file. By default, the name of the stopword list file is extra_stopword.dic.
    vi extra_stopword.dic
  8. Run the following command to return to the bin directory.
    cd ..
  9. Run the following command to upload the configuration set to the server:
    ./search-cli zk upconfig -d conf -n default.myTable.myIdx
  10. Run the following command to make the configuration set take effect:
    ./search-cli  reload_collection -c default.myTable.myIdx