1、首先上图:
2、创建索引【PUT方法】
索引的分片数和副本数为12和0
http://127.0.0.1:9200/demo_comment_message { "settings": { "number_of_shards": 12, "number_of_replicas": 0 }, "mappings": { "properties": { "commentId": { "type": "keyword" }, "desc": { "type": "text" }, "videoId": { "type": "keyword" }, "diggCount": { "type": "integer" }, "createTime": { "type": "long" }, "lastUpdateTime": { "type": "long" } } }}3、添加索引字段【PUT方法】
http://127.0.0.1:9200/demo_comment_message/_mapping{ "properties": { "type": { "type": "long" } }}
4、删除索引【DELETE方法】--此方法删除所有的索引,谨慎使用
http://127.0.0.1:9200/demo_comment_message { "properties": { "type": { "type": "long" } }}