es根据条件更新索引

UpdateByQueryRequest request = new UpdateByQueryRequest(indexname);
request.setQuery(queryBuilder);
request.setScript(
        new Script(
                ScriptType.INLINE, "painless",
                "if (ctx._source.money == '111') {ctx._source.money='222';}",
                Collections.emptyMap()));
BulkByScrollResponse bulkResponse =
        client.updateByQuery(request, RequestOptions.DEFAULT);
 log.info(""+bulkResponse.getTotal());
    原文作者:方方园园
    原文地址: https://blog.csdn.net/qq_22041375/article/details/106732827
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞