我有大量的文档,它们具有相同的索引和相同的类型,但ID明显不同。我想更新现有的或者批量插入新的。如何使用批量索引API实现它?我想做下面这样的事情,但它抛出了错误。基本上,我想批量插入多个具有相同索引和相同类型的文档。
curl -s -H "Content-Type: application/json" -XPOST localhost:9200/_bulk -d'
{ "index": {"_type": "sometype", "_index": "someindex"}}
{ "_id": "existing_id", "field1": "test1"}
{ "_id": "existing_id2", "field2": "test2"}
'