restclient.asciidoc 1.0 KB

1234567891011121314151617181920
  1. [[breaking_70_restclient_changes]]
  2. === High-level REST client changes
  3. ==== API methods accepting `Header` argument have been removed
  4. All API methods accepting headers as a `Header` varargs argument, deprecated
  5. since 6.4, have been removed in favour of the newly introduced methods that
  6. accept instead a `RequestOptions` argument. In case you are not specifying any
  7. header, e.g. `client.index(indexRequest)` becomes
  8. `client.index(indexRequest, RequestOptions.DEFAULT)`.
  9. In case you are specifying headers
  10. e.g. `client.index(indexRequest, new Header("name" "value"))` becomes
  11. `client.index(indexRequest, RequestOptions.DEFAULT.toBuilder().addHeader("name", "value").build());`
  12. ==== Cluster Health API default to `cluster` level
  13. The Cluster Health API used to default to `shards` level to ease migration
  14. from transport client that doesn't support the `level` parameter and always
  15. returns information including indices and shards details. The level default
  16. value has been aligned with the Elasticsearch default level: `cluster`.