1. 程式人生 > 其它 >ElasticSearch 在 kibana中的_bulk批量操作

ElasticSearch 在 kibana中的_bulk批量操作

put 方式 建立 索引


 如果繼續點選建立 則會報錯  說該索引已存在

 
建立文件

 獲取文件

測試資料
_bulk批量操作,語法格式
json
{action:{metadata}}\n
{request body }\n
{action:{metadata}}\n
{request body }\n
```

案例

```json
POST /bobo/system/_bulk
{"index":{"_id":"1"}}
{"name":"dpb"}
{"index":{"_id":"2"}}
{"name":"dpb2"}
此時我們發現提交的資料 在postman中不支援 所以 我們用kibana
訪問kibana
http://192.168.1.137:5601
POST /lcc/system/_bulk
{"index":{"_id":"1"}}
{"name":"dpb"}
{"index":{"_id":"2"}}
{"name":"dpb2"}



獲取文件資料驗證

複雜點的案例:

json
POST /_bulk   這是在所有索引庫下操作
{"delete":{"_index":"website","_type":"blog","_id":"123"}}
{"create":{"_index":"website","_type":"blog","_id":"123
"}} {"title":"My first bolg post ..."} {"index":{"_index":"website","_type":"blog"}} {"title":"My second blog post ..."} {"update":{"_index":"website","_type":"blog","_id":"123"}} {"doc":{"title":"My updated blog post ..."}}