es8.5.3版本使用ElasticsearchClient客户端ReindexRequest操作报错
Elasticsearch | 作者 LiHaodong | 发布于2023年05月21日 | 阅读数:2751
String dsl = "{\"bool\":{\"must_not\": [{\"term\": {\"labelNo.keyword\":\"D0401016004\"}}]}}";
ReindexRequest.Builder builder = new ReindexRequest.Builder();
builder.source(s -> s.index("batch_temporary_table_3001").query(QueryBuilders.wrapper(b -> b.query(dsl))));
builder.dest(d -> d.index("batch_temporary_table_3002"));
client.reindex(builder.build());
报错信息:co.elastic.clients.elasticsearch._types.ElasticsearchException:[es/reindex] failed: [x_content_parse_exception] [1:207] [reindex] failed to parse field [source]
如果去掉 .query(QueryBuilders.wrapper(b -> b.query(dsl)))
可以正常执行,就是加了条件除出了问题。
Source: {"index":["group_label_custr_20230518"],"query":{"wrapper":{"query":"{\"bool\":{\"must_not\": [{\"term\": {\"labelNo.keyword\":\"D0401016004\"}}]}}"}}}
ReindexRequest.Builder builder = new ReindexRequest.Builder();
builder.source(s -> s.index("batch_temporary_table_3001").query(QueryBuilders.wrapper(b -> b.query(dsl))));
builder.dest(d -> d.index("batch_temporary_table_3002"));
client.reindex(builder.build());
报错信息:co.elastic.clients.elasticsearch._types.ElasticsearchException:[es/reindex] failed: [x_content_parse_exception] [1:207] [reindex] failed to parse field [source]
如果去掉 .query(QueryBuilders.wrapper(b -> b.query(dsl)))
可以正常执行,就是加了条件除出了问题。
Source: {"index":["group_label_custr_20230518"],"query":{"wrapper":{"query":"{\"bool\":{\"must_not\": [{\"term\": {\"labelNo.keyword\":\"D0401016004\"}}]}}"}}}
1 个回复
mryu
赞同来自: