记录ES删除字段方法

it2022-05-05  211

记录ES删除字段方法

BoolQueryBuilder boolQueryBuilder =new BoolQueryBuilder(); boolQueryBuilder.must(QueryBuilders.existsQuery("labelgroup"+tagGroupCode)); UpdateByQueryRequestBuilder updateByQuery = UpdateByQueryAction.INSTANCE.newRequestBuilder(client); updateByQuery.source(instanceId.toLowerCase()).script(new Script(ScriptType.INLINE , "painless","ctx._source.remove(\'"+"labelgroup"+tagGroupCode+"\')" , Collections.emptyMap())).filter(boolQueryBuilder) .abortOnVersionConflict(false); BulkByScrollResponse response = updateByQuery.get();

最新回复(0)