我试图运行spring启动应用程序RestHighLevelClient7.17.48.5.1通过跟随指南。当应用程序尝试调用get,我有以下错误:Elasticsearch exception [type=illegal_argument_exception, reason=request [/*] contains unrecognized parameter: [include_type_name]]
我的配置RestHighLevelClient在兼容模式:
@Value("${hs360.services.watchlist.mgmt.elasticsearch.host}")
private String elsHost;
@Value("${hs360.services.watchlist.mgmt.elasticsearch.port}")
private int elsRestPort;
@Bean(destroyMethod = "close")
public RestHighLevelClient sourceClient() {
return new RestHighLevelClientBuilder(
RestClient.builder(new HttpHost(elsHost, elsRestPort)).setRequestConfigCallback(r -> r.setConnectTimeout(60000).setSocketTimeout(90000)).build()
).setApiCompatibilityMode(true).build();
}
和代码片段,当应用程序尝试调用get:
时GetIndexResponse indexResponse = restHighLevelClient.indices().get(new GetIndexRequest().indices("*"), RequestOptions.DEFAULT);
从请求日志中我可以明显地看到,该请求包含参数include_type_name
org.elasticsearch.client.RestClient : request [GET http://hs360-ss-s
ource-master:9200/*?master_timeout=30s&include_type_name=true&ignore_unavailable=false&expand_wildcards=open&all
ow_no_indices=true&ignore_throttled=false] returned 1 warnings: [299 Elasticsearch-8.5.1-c1310c45fc534583afe2c1c
03046491efba2bba2 "[ignore_throttled] parameter is deprecated because frozen indices have been deprecated. Consi
der cold or frozen tiers in place of frozen indices."]
我知道,这个参数被弃用了,我认为兼容性模型会处理这个,但显然,还有别的东西。我试图寻找解决方案,当我可以从请求中删除参数时,但没有成功。
我如何从请求中删除该参数或解决此问题?
你要么升级到支持ES 8.5的Spring Boot 3.0,要么降级到支持ES 8.5的Spring Boot版本