我想BulkIndexRequest
从 Go 包中使用elastic
。我试图找到示例,但似乎它们不存在。所以如果有人用过它,你能帮我用它来创建像下面这样的请求吗?
curl -s -H "Content-Type: application/json" -XPOST localhost:9200/someindex/sometype/_bulk -d'
{ "index": {"_id": "existing_id"}}
{ "field1": "test1"}
{ "index": {"_id": "existing_id2"}}
{ "field2": "test2"}
'