附录:手动&自动生成document id
1、手动指定document id
put /index/type/id
{
"JSON数据"
}PUT /test_index/test_type/2
{
"test_content": "my test"
}2、自动生成document id
Last updated
put /index/type/id
{
"JSON数据"
}PUT /test_index/test_type/2
{
"test_content": "my test"
}Last updated
post /index/type
{
"JSON数据"
}POST /test_index/test_type
{
"test_content": "my test"
}{
"_index": "test_index",
"_type": "test_type",
"_id": "AVp4RN0bhjxldOOnBxaE",
"_version": 1,
"result": "created",
"_shards": {
"total": 2,
"successful": 1,
"failed": 0
},
"created": true
}