elastic/elasticsearch-java

IndicesOptions for all requests

bilak opened this issue · 1 comments

bilak commented

Description

Hello,
in previous version [<8.x] it was possible to create GetIndexRequest with IndicesOptions. The new co.elastic.clients.elasticsearch.indices.GetIndexRequest doesn't contain these options and it's always needed to add them through builder. Would it be possible to add IndicesOptions as builder field? It's used for example in SearchInputRequestDefinition.

Benefit: it will be easier to provide default config for multiple requests.

Hello, the reason for the difference between those two requests in the new java client is because they are different in the JSON representation, which the new client tries to stay as close to as possible. In the official documentation for GetIndex, those options are query parameters, while in SearchInputhttps it's a setting object, and the new client reflects that.