您好,登錄后才能下訂單哦!
使用bulk批量操作數據庫
格式:
{"index":{"_index":"home","_type":"home",""_id":"2"}}
{"id": 2, "location": "南京市棲霞區馬群街道29號", "money": 3000, "area":80, "type": "三居室", "style": "整租"}
第一行指定請求與索引和類型,可以選擇的請求有"create","index","delete","ubdate",
"_index"指定索引名,"_type"指定類型名,"_id"指定id
第二行指定插入的內容.
如request.json:
{"index":{"_index":"home","_type":"home","_id":"2"}}
{"id": 2, "location": "南京市棲霞區馬群街道29號", "money": 3000, "area":80, "type": "三居室", "style": "整租"}
{"index":{"_index":"home","_type":"home","_id":"3"}}
{"id": 3, "location": "南京市玄武區山西路門路29號", "money": 400, "area":15, "type": "四居室", "style": "合租"}
{"index":{"_index":"home","_type":"home","_id":"4"}}
{"id": 4, "location": "南京市秦淮區山北京東路29號", "money": 500, "area":14, "type": "三居室", "style": "合租"}
{"index":{"_index":"home","_type":"home","_id":"5"}}
{"id": 5, "location": "南京市秦淮區新街口29號", "money": 450, "area":16, "type": "四居室", "style": "合租"}
在數據庫根目錄執行:
curl -XPUT 'localhost:9200/_bulk' -H "Content-Type: application/json" --data-binary @request.json
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。