ElasticSearch bulk insert/update operation

前端 未结 2 1066
孤街浪徒
孤街浪徒 2021-02-07 07:35

I am not sure if I am using correctly the upsert operation in bulk indexing.

My request is:

{ \"update\": {\"_id\": \"610946100\"}}\\n
{\"do         


        
2条回答
  •  迷失自我
    2021-02-07 07:50

    The only thing I see that differs between your request and the Bulk Documentation is that the examples have the index and type defined in the update action. So based on this I would try adding those values like the following.

    {"update": {"_id": "610946100", "_type": "aType", "_index": "anIndex"}}\n
    {"doc": {"uri":"/0/0/1/6/4/0/610946100.xml"}, "doc_as_upsert" : true}\n
    

    Additionally since you are specifying the document _id in the update command, I would remove it from the partial document, or mark it as _id. (You were missing the underscore)

提交回复
热议问题