Honor IndicesOptions in HLRC putMapping request (#57118)
Currently, the IndicesOptions set on a High Level rest client PutMappingRequest are not correctly converted to request parameters. This change adds the missing conversion and tests. Closes #57045
This commit is contained in:
parent
d6b79bcd95
commit
277c5eaf56
|
@ -155,6 +155,7 @@ final class IndicesRequestConverters {
|
|||
RequestConverters.Params parameters = new RequestConverters.Params();
|
||||
parameters.withTimeout(putMappingRequest.timeout());
|
||||
parameters.withMasterTimeout(putMappingRequest.masterNodeTimeout());
|
||||
parameters.withIndicesOptions(putMappingRequest.indicesOptions());
|
||||
request.addParameters(parameters.asMap());
|
||||
request.setEntity(RequestConverters.createEntity(putMappingRequest, RequestConverters.REQUEST_BODY_CONTENT_TYPE));
|
||||
return request;
|
||||
|
|
|
@ -213,6 +213,8 @@ public class IndicesRequestConvertersTests extends ESTestCase {
|
|||
Map<String, String> expectedParams = new HashMap<>();
|
||||
RequestConvertersTests.setRandomTimeout(putMappingRequest, AcknowledgedRequest.DEFAULT_ACK_TIMEOUT, expectedParams);
|
||||
RequestConvertersTests.setRandomMasterTimeout(putMappingRequest, expectedParams);
|
||||
RequestConvertersTests.setRandomIndicesOptions(putMappingRequest::indicesOptions,
|
||||
putMappingRequest::indicesOptions, expectedParams);
|
||||
|
||||
Request request = IndicesRequestConverters.putMapping(putMappingRequest);
|
||||
|
||||
|
|
Loading…
Reference in New Issue