UpdateSynonymsDicts
Updates the synonym dictionary of an Alibaba Cloud Elasticsearch instance.
Operation description
When you call this operation, take note of the following items:
If the dictionary file is sourced from OSS, ensure that the OSS bucket is publicly readable.
If an uploaded dictionary is not configured with ORIGIN, the dictionary file is deleted after you call this operation.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
elasticsearch:UpdateDict |
update |
*Instance
|
None | None |
Request syntax
PUT /openapi/instances/{InstanceId}/synonymsDict HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The instance ID. |
es-cn-nif1q9o8r0008**** |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| clientToken |
string |
No |
The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique across different requests. The token can be up to 64 ASCII characters in length. |
5A2CFF0E-5718-45B5-9D4D-70B3FF**** |
| body |
string |
No |
The file name, source, and OSS file information of the synonym dictionary. |
[{"name":"SYSTEM_STOPWORD.txt","sourceType":"ORIGIN","type":"SYNONYMS"}] |
Request body
You must also specify the following parameters in the request body.
| Parameter | Type | Required | Example | Description |
| name | String | Yes | dic_0.txt | The name of the uploaded dictionary file. The file must be in the TXT format. |
| ossObject | Array | No | The description of the OSS file. This parameter is required when sourceType is set to OSS. | |
| └bucketName | String | No | search-cloud-test-cn-**** | The name of the OSS bucket. |
| └key | String | No | oss/dic_0.txt | The storage path of the dictionary file in the OSS bucket. |
| sourceType | String | Yes | OSS | The source type of the dictionary file. Valid values: OSS (uses OSS) and ORIGIN (retains the previously uploaded dictionary). Note: You must upload local files to OSS and then reference them from OSS. If an uploaded dictionary is not configured with ORIGIN, the system deletes the dictionary. |
| type | String | Yes | SYNONYMS | The type of the dictionary to be updated. Set the value to SYNONYMS. |
└ indicates a child parameter.
Example:
[
{
"name":"deploy_0.txt",
"ossObject":{
"bucketName":"search-cloud-test-cn-****",
"key":"user_dict/dict_0.dic"
},
"sourceType":"OSS",
"type":"SYNONYMS"
},
{
"name":"SYSTEM_STOPWORD.txt",
"sourceType":"ORIGIN",
"type":"SYNONYMS"
}
]
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
7C5622CC-B312-426F-85AA-B0271******* |
| Result |
array<object> |
The returned result. |
|
|
object |
|||
| fileSize |
integer |
The size of the dictionary file. Unit: bytes. |
220 |
| sourceType |
string |
The source type of the dictionary file. Valid values:
|
OSS |
| name |
string |
The name of the dictionary file. |
deploy_0.txt |
| type |
string |
The dictionary type. Valid value: SYNONYMS (synonyms). |
SYNONYMS |
Examples
Success response
JSON format
{
"RequestId": "7C5622CC-B312-426F-85AA-B0271*******",
"Result": [
{
"fileSize": 220,
"sourceType": "OSS",
"name": "deploy_0.txt",
"type": "SYNONYMS"
}
]
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.