

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 刪除儲存庫
<a name="index-synonyms-delete"></a>

下列程序示範如何刪除儲存庫。

------
#### [ Console ]

1. 在左側導覽窗格中，在您要修改的索引下，選擇**同義詞**。

1. 在**同義詞**頁面上，選取您要刪除的儲存庫。

1. 在 **Thesaurus 詳細資訊**頁面上，選擇**刪除**，然後確認要刪除。

------
#### [ CLI ]

若要使用 刪除索引的 sarus AWS CLI，請呼叫 `delete-thesaurus`：

```
aws kendra delete-thesaurus \
--index-id index-id \
--id thesaurus-id
```

------
#### [ Python ]

```
import boto3
from botocore.exceptions import ClientError

kendra = boto3.client("kendra")

print("Delete a thesaurus")

thesaurus_id = "thesaurus-id"
index_id = "index-id"

try:
    kendra.delete_thesaurus(
        Id = thesaurus_id,
        IndexId = index_id
    )

except ClientError as e:
        print("%s" % e)

print("Program ends.")
```

------
#### [ Java ]

```
package com.amazonaws.kendra;

import software.amazon.awssdk.services.kendra.KendraClient;
import software.amazon.awssdk.services.kendra.model.DeleteThesaurusRequest;

public class DeleteThesaurusExample {

  public static void main(String[] args) throws InterruptedException {

    KendraClient kendra = KendraClient.builder().build();

    String thesaurusId = "thesaurus-id";
    String indexId = "index-id";

    DeleteThesaurusRequest updateThesaurusRequest = DeleteThesaurusRequest
        .builder()
        .id(thesaurusId)
        .indexId(indexId)
        .build();
    kendra.deleteThesaurus(updateThesaurusRequest);
  }
}
```

------