可以查看elastic文档官方文档
1.Index 创建test
索引库
PUT //127.0.0.1:9200/test
{
"settings" : {
"index" : {
"number_of_shards" : 3,
"number_of_replicas" : 2
}
}
}
2.Mappings 设置test
索引库里面的字段
PUT //127.0.0.1:9200/test/_mapping
{
"properties": {
"email": {
"type": "keyword"
}
}
}
3.创建并设置test
索引库字段
PUT //127.0.0.1:9200/test
{
"settings" : {
"index" : {
"number_of_shards" : 3,
"number_of_replicas" : 2
}
},
"properties": {
"email": {
"type": "keyword"
}
}
}
删除product库
DELETE //127.0.0.1:9200/product
清除ElasticSearch所有数据
DELETE //127.0.0.1:9200/_all
...未完待续