您基本上可以使用查询API更新来实现所需的功能,基本上是这样的:
POST index/_update_by_query{ "query": { "match": { "id": "5b1676493d21784208c36041" } }, "script": { "source": "ctx._source = params", "params": { "dataSource": "ELASTIC", "entity": "vertices", "label": "vertices" } }}更新:使用Java API
Map<String, String> params = new HashMap<>();params.put("dataSource", "ELASTIC");params.put("entity", "vertices");params.put("label", "vertices");UpdateByQueryRequestBuilder updateByQuery = UpdateByQueryAction.INSTANCE.newRequestBuilder(client);updateByQuery.source("index") .filter(QueryBuilders.matchQuery("id", "5b1676493d21784208c36041")) .size(1000) .script(new script(scriptType.INLINE, "painless", "ctx._source.putAll(params)", params));BulkByScrollResponse response = updateByQuery.get();有关使用UpdateByQuery Java
API和Java高级Rest
客户端的更多详细信息



