Elasticsearch bulk index api via rest endpoint

后端 未结 2 692
死守一世寂寞
死守一世寂寞 2020-12-11 02:59

Here is my request:

POST /_bulk
{ \"index\" : { \"_index\" : \"test\", \"_type\" : \"type1\", \"_id\" : \"1\" } }
{\"firstname\":\"first_name1\",\"lastname\"         


        
2条回答
  •  执笔经年
    2020-12-11 03:44

    As Samyak says in his comment, "don't repeat yourself". This syntax is tidier.

    post /test/_type/_bulk
    { "index": {}}
    {"firstname":"first_name1","lastname":"last_name1"}
    { "index": { }}
    { "name": "Test2", "data": "This is my test data2" }
    

提交回复
热议问题