#旧
#创建一个有数据的 索引库
# /索引名/~类型名~/文档id
PUT /test1/type1/1
{
"name":"红枣信",
"age":3
}
GET test1
#新
#创建一个无数据的 索引库
PUT /test2
{
"mappings": {
"properties": {
"name":{
"type": "text"
},
"age":{
"type": "long"
},
"brithday":{
"type": "date"
}
}
}
}
#可以通过get 获取 索引具体信息
GET test1
#获取数据库的健康状态
GET _cat/health
#获取有多少个索引库
GET _cat/indices?v
#创建一个有内容索引
PUT test3/_doc/1
{
"name":"信",
"age":18,
"birth":"2021-1-2"
}
#更新 修改内容
POST test3/_update/1
{
"doc": {
"name":"狂三"
}
}
#删除索引库
DELETE test2
#根据索引中的1进行擅长内容,而不是删除一个索引库
DELETE test3/_doc/1
#添加多个数据
PUT /hong/user/1
{
"name":"红枣信",
"age":18,
"desc":"最后两个星期,坚持",
"tags":["学","努","加"]
}