Elasticsearch 7.0变化

版权声明:本文为博主原创文章,欢迎转载。 https://blog.csdn.net/chengyuqiang/article/details/85265224

Elasticsearch 7.0变化

1、官方文档

https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking-changes-7.0.html

2、High-level REST client 改变

(1)API methods accepting Header argument have been removed/已删除接受Header参数的API方法

All API methods accepting headers as a Header varargs argument, deprecated since 6.4, have been removed in favour of the newly introduced methods that accept instead a RequestOptions argument.
所有接受headers 作为Header varargs参数的API方法,自6.4以来已弃用,已被删除,以支持新引入的接受RequestOptions参数的方法。

In case you are not specifying any header, e.g. client.index(indexRequest) becomes client.index(indexRequest, RequestOptions.DEFAULT). In case you are specifying headers e.g. client.index(indexRequest, new Header(“name” “value”)) becomes client.index(indexRequest, RequestOptions.DEFAULT.toBuilder().addHeader(“name”, “value”).build());
如果您没有指定任何header,例如 client.index(indexRequest)变为client.index(indexRequest,RequestOptions.DEFAULT)。 如果您要指定header,例如 client.index(indexRequest, new Header("name" "value"))成为client.index(indexRequest, RequestOptions.DEFAULT.toBuilder().addHeader("name", "value").build());

(2)Cluster Health API default to cluster level /Cluster Health API默认为群集级别

The Cluster Health API used to default to shards level to ease migration from transport client that doesn’t support the level parameter and always returns information including indices and shards details. The level default value has been aligned with the Elasticsearch default level: cluster.
Cluster Health API用于默认为分片级别,以便于从不支持level参数的传输客户端迁移,并始终返回包括索引和分片详细信息在内的信息。 级别默认值已与Elasticsearch默认级别cluster对齐。

猜你喜欢

转载自blog.csdn.net/chengyuqiang/article/details/85265224