Docs
ues
Elasticsearch
Synonyms Operation

Upload Synonym Files

When using synonyms through synonym files, you need to upload the synonym files first. This article introduces the precautions and operation steps for uploading synonym files.

Precautions

  1. A single dictionary file supports up to 4MB, and supports up to 5 dictionary files. The file name supports uppercase and lowercase letters, numbers, and underscores. Do not exceed 30 characters in length

  2. Supports single file upload at a time

  3. Synonym files require a synonym expression per line (expressions support Solr rules and WordNet rules), and the file needs to be in utf-8 encoding, with a .txt extension

  4. After uploading and updating the synonym dictionary, you need to perform a cluster restart operation to take effect

Operation Steps

  1. Enter the target Elasticsearch instance on the console

  2. Enter the synonym management page, click upload file, choose to upload the synonym file and confirm.

Synonym Management Page

Click Upload File

Next Steps

Wait for the status of the instance to become normal, log in to the Kibana console to create indices, validate synonyms, and upload test data for search testing. When creating an index, you need to configure settings and mapping, and need to set “synonyms_path”: “analysis/your_dict_name.txt” in settings.