//新建索引
put index01
// 获取索引
get index01
新建文档不指明ID,文档ID随机生成
POST test1/_doc
{
"name": "test",
"age": "30"
}
POST test4/_doc/
{
"@timestamp": "2099-11-15T13:12:00",
"message": "GET /search HTTP/1.1 200 1070000",
"user": {
"id": "kimchy"
}
}
_doc 代表文档,新建文档指明ID
POST test1/_doc/1
{
"name": "jack",
"age": "30"
}
获取文档 指定ID
GET test1/_doc/1
查找所有文档
GET test1/_search
查找byname
GET test1/_search?q=name:jack
/* 全局更新
PUT test1/_doc/1
{
"name":"rose",
"age": "34"
}
//局部更新
POST test1/_update/1
{
"doc": {
"name": "new_name2"
}
}
新建别名
PUT my-index-02/_alias/my-alias
新建mapping
PUT /test
{
"settings": {
"number_of_shards": 1
},
"mappings": {
"properties": {
"field1": { "type
|