通过 Elasticsearch 的 RESTFul API 来创建索引:
PUT http://{host}:9200/{index}
默认情况下,创建的索引分片数量是 5 个,副本数量是 1 个。
如果要指定分片数、副本数量:
{
"settings": {
"number_of_shards": 3,
"number_of_replicas": 2
}
}
使用CURL命令
curl -X PUT "localhost:9200/es_index_20230801?pretty"
参考:https://www.exception.site/elasticsearch/elasticsearch-create-index
标签:index,9200,创建,number,索引,ES From: https://www.cnblogs.com/aaacarrot/p/17608023.html