在AWS Opensearch控制台的左侧菜单中,点击"Index Management"选项,然后点击"Create Index"来创建新的索引。在创建索引后,您将看到新的Indices选项卡出现在AWS Opensearch标签页上。以下是示例代码:
PUT /my-index
{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 1
},
"mappings": {
"properties": {
"title": {
"type": "text",
"analyzer": "standard"
},
"description": {
"type": "text",
"analyzer": "english"
},
"timestamp": {
"type": "date"
}
}
}
}
这段代码将创建一个名为"my-index"的新索引,并定义了一些属性。您可以根据需要进行修改。创建索引后,您将看到在AWS Opensearch控制台标签页上出现Indices选项卡。