// 查看所有索引
GET /_cat/indices?v
// 创建指定索引 customer
PUT /customer?pretty
// 查看指定索引信息 customer
GET /customer/
// 查看指定索引数据信息
GET /customer/_search
// 给指定索引添加指定的id数据信息
PUT /customer/external/1
{
"name": "John Doe"
}
// 查看指定索引的id 这里查看id为1的数据信息
GET /customer/external/1
// 删除指定索引信息
DELETE /customer?pretty
// 创建指定索引
PUT /demo?pretty
// 查看指定索引信息
GET /demo
// 创建结构化索引
PUT /demo/main_info/_mappings
{
"properties": {
"name": {
"type": "text"
},
"country": {
"type": "keyword"
},
"age": {
"type": "integer"
},
"date": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
}
}
}
// 查看指定索引信息 此时可看到相应的结构化索引信息
GET /demo