假设我有 1000 个用户,每个用户有 50 个文档(每个文档嵌入具有名称和电子邮件的用户对象),我需要更新一组用户的名称和电子邮件。
我想使用 Bulk Api,但似乎 bulk API 只支持“_id”作为参数。我想改为查询
例如:我想做,
POST _bulk
{ "update" : {"query" : {"terms": {"userId": "25"}}, "_type" : "comments", "_index" : "comments"} }
{ "doc" : {"user.name" : "new name"} }
代替
POST _bulk
{ "update" : {"_id" : "1", "_type" : "comments", "_index" : "comments"} }
{ "doc" : {"user.name" : "new name"} }