批量插入

  1. curl -H "content-type: application/json" -XPOST -d'
  2. {"index": {"_id": "v1"}}\n
  3. {"field1": "value", "field2": {"feature": []}}\n
  4. {"index": {"_id": "v2"}}\n
  5. {"field1": "value", "field2": {"feature": []}}\n
  6. ' http://router_server/$db_name/$space_name/_bulk

json格式的变体,{“index”: {“_id”: “v1”}} 指定记录的id, {“field1”: “value”, “field2”: {“feature”: []}} 指定插入的数据,每行json字符串均以\n结尾。