Skip to content

Commit

Permalink
switched to RequestOptions from Headers
Browse files Browse the repository at this point in the history
  • Loading branch information
sohaibiftikhar committed Jun 7, 2018
1 parent 7bcc283 commit 53b0747
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1068,9 +1068,9 @@ public void putTemplateAsync(PutIndexTemplateRequest putIndexTemplateRequest, Re
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/search-validate.html"> Validate Query API
* on elastic.co</a>
*/
public ValidateQueryResponse validateQuery(ValidateQueryRequest validateQueryRequest, Header... headers) throws IOException {
return restHighLevelClient.performRequestAndParseEntity(validateQueryRequest, RequestConverters::validateQuery,
ValidateQueryResponse::fromXContent, emptySet(), headers);
public ValidateQueryResponse validateQuery(ValidateQueryRequest validateQueryRequest, RequestOptions options) throws IOException {
return restHighLevelClient.performRequestAndParseEntity(validateQueryRequest, RequestConverters::validateQuery, options,
ValidateQueryResponse::fromXContent, emptySet());
}

/**
Expand All @@ -1079,9 +1079,9 @@ public ValidateQueryResponse validateQuery(ValidateQueryRequest validateQueryReq
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/search-validate.html"> Validate Query API
* on elastic.co</a>
*/
public void validateQueryAsync(ValidateQueryRequest validateQueryRequest,
ActionListener<ValidateQueryResponse> listener, Header... headers) {
restHighLevelClient.performRequestAsyncAndParseEntity(validateQueryRequest, RequestConverters::validateQuery,
ValidateQueryResponse::fromXContent, listener, emptySet(), headers);
public void validateQueryAsync(ValidateQueryRequest validateQueryRequest, RequestOptions options,
ActionListener<ValidateQueryResponse> listener) {
restHighLevelClient.performRequestAsyncAndParseEntity(validateQueryRequest, RequestConverters::validateQuery, options,
ValidateQueryResponse::fromXContent, listener, emptySet());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2019,7 +2019,7 @@ public void testValidateQuery() throws IOException, InterruptedException {
// end::validate-query-request-rewrite

// tag::validate-query-execute
ValidateQueryResponse response = client.indices().validateQuery(request); // <1>
ValidateQueryResponse response = client.indices().validateQuery(request, RequestOptions.DEFAULT); // <1>
// end::validate-query-execute

// tag::validate-query-response
Expand Down Expand Up @@ -2061,7 +2061,7 @@ public void onFailure(Exception e) {
listener = new LatchedActionListener<>(listener, latch);

// tag::validate-query-execute-async
client.indices().validateQueryAsync(request, listener); // <1>
client.indices().validateQueryAsync(request, RequestOptions.DEFAULT, listener); // <1>
// end::validate-query-execute-async

assertTrue(latch.await(30L, TimeUnit.SECONDS));
Expand Down

0 comments on commit 53b0747

Please sign in to comment.