mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-25 07:37:19 -04:00
Do not send default ignore_throttled parameter since it is deprecated (#84827)
This commit is contained in:
parent
e7fa335b8b
commit
4c41c7a9f4
3 changed files with 27 additions and 6 deletions
|
@ -1086,8 +1086,10 @@ final class RequestConverters {
|
||||||
expandWildcards = joiner.toString();
|
expandWildcards = joiner.toString();
|
||||||
}
|
}
|
||||||
putParam("expand_wildcards", expandWildcards);
|
putParam("expand_wildcards", expandWildcards);
|
||||||
|
if (indicesOptions.ignoreThrottled() == false) {
|
||||||
putParam("ignore_throttled", Boolean.toString(indicesOptions.ignoreThrottled()));
|
putParam("ignore_throttled", Boolean.toString(indicesOptions.ignoreThrottled()));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1773,7 +1773,10 @@ public class RequestConvertersTests extends ESTestCase {
|
||||||
endpoint.add("_field_caps");
|
endpoint.add("_field_caps");
|
||||||
|
|
||||||
assertEquals(endpoint.toString(), request.getEndpoint());
|
assertEquals(endpoint.toString(), request.getEndpoint());
|
||||||
int expectedSize = FieldCapabilitiesRequest.DEFAULT_INDICES_OPTIONS.equals(fieldCapabilitiesRequest.indicesOptions()) ? 1 : 5;
|
int expectedSize = expectedParameterCount(
|
||||||
|
FieldCapabilitiesRequest.DEFAULT_INDICES_OPTIONS,
|
||||||
|
fieldCapabilitiesRequest.indicesOptions()
|
||||||
|
);
|
||||||
assertEquals(expectedSize, request.getParameters().size());
|
assertEquals(expectedSize, request.getParameters().size());
|
||||||
|
|
||||||
// Note that we don't check the field param value explicitly, as field names are
|
// Note that we don't check the field param value explicitly, as field names are
|
||||||
|
@ -1814,7 +1817,10 @@ public class RequestConvertersTests extends ESTestCase {
|
||||||
endpoint.add("_field_caps");
|
endpoint.add("_field_caps");
|
||||||
|
|
||||||
assertEquals(endpoint.toString(), request.getEndpoint());
|
assertEquals(endpoint.toString(), request.getEndpoint());
|
||||||
int expectedSize = FieldCapabilitiesRequest.DEFAULT_INDICES_OPTIONS.equals(fieldCapabilitiesRequest.indicesOptions()) ? 1 : 5;
|
int expectedSize = expectedParameterCount(
|
||||||
|
FieldCapabilitiesRequest.DEFAULT_INDICES_OPTIONS,
|
||||||
|
fieldCapabilitiesRequest.indicesOptions()
|
||||||
|
);
|
||||||
assertEquals(expectedSize, request.getParameters().size());
|
assertEquals(expectedSize, request.getParameters().size());
|
||||||
|
|
||||||
// Note that we don't check the field param value explicitly, as field names are
|
// Note that we don't check the field param value explicitly, as field names are
|
||||||
|
@ -1855,7 +1861,7 @@ public class RequestConvertersTests extends ESTestCase {
|
||||||
}
|
}
|
||||||
endpoint.add(RestRankEvalAction.ENDPOINT);
|
endpoint.add(RestRankEvalAction.ENDPOINT);
|
||||||
assertEquals(endpoint.toString(), request.getEndpoint());
|
assertEquals(endpoint.toString(), request.getEndpoint());
|
||||||
int expectedSize = SearchRequest.DEFAULT_INDICES_OPTIONS.equals(rankEvalRequest.indicesOptions()) ? 1 : 5;
|
int expectedSize = expectedParameterCount(SearchRequest.DEFAULT_INDICES_OPTIONS, rankEvalRequest.indicesOptions());
|
||||||
assertEquals(expectedSize, request.getParameters().size());
|
assertEquals(expectedSize, request.getParameters().size());
|
||||||
assertEquals(expectedParams, request.getParameters());
|
assertEquals(expectedParams, request.getParameters());
|
||||||
assertToXContentBody(spec, request.getEntity());
|
assertToXContentBody(spec, request.getEntity());
|
||||||
|
@ -2241,8 +2247,10 @@ public class RequestConvertersTests extends ESTestCase {
|
||||||
} else {
|
} else {
|
||||||
expectedParams.put("expand_wildcards", "none");
|
expectedParams.put("expand_wildcards", "none");
|
||||||
}
|
}
|
||||||
|
if (getter.get().ignoreThrottled() == false) {
|
||||||
expectedParams.put("ignore_throttled", Boolean.toString(getter.get().ignoreThrottled()));
|
expectedParams.put("ignore_throttled", Boolean.toString(getter.get().ignoreThrottled()));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static IndicesOptions setRandomIndicesOptions(IndicesOptions indicesOptions, Map<String, String> expectedParams) {
|
static IndicesOptions setRandomIndicesOptions(IndicesOptions indicesOptions, Map<String, String> expectedParams) {
|
||||||
if (randomBoolean()) {
|
if (randomBoolean()) {
|
||||||
|
@ -2268,10 +2276,16 @@ public class RequestConvertersTests extends ESTestCase {
|
||||||
} else {
|
} else {
|
||||||
expectedParams.put("expand_wildcards", "none");
|
expectedParams.put("expand_wildcards", "none");
|
||||||
}
|
}
|
||||||
|
if (indicesOptions.ignoreThrottled() == false) {
|
||||||
expectedParams.put("ignore_throttled", Boolean.toString(indicesOptions.ignoreThrottled()));
|
expectedParams.put("ignore_throttled", Boolean.toString(indicesOptions.ignoreThrottled()));
|
||||||
|
}
|
||||||
return indicesOptions;
|
return indicesOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int expectedParameterCount(IndicesOptions defaultOptions, IndicesOptions indicesOptions) {
|
||||||
|
return defaultOptions.equals(indicesOptions) ? 1 : indicesOptions.ignoreThrottled() ? 4 : 5;
|
||||||
|
}
|
||||||
|
|
||||||
static void setRandomIncludeDefaults(Consumer<Boolean> setter, Map<String, String> expectedParams) {
|
static void setRandomIncludeDefaults(Consumer<Boolean> setter, Map<String, String> expectedParams) {
|
||||||
if (randomBoolean()) {
|
if (randomBoolean()) {
|
||||||
boolean includeDefaults = randomBoolean();
|
boolean includeDefaults = randomBoolean();
|
||||||
|
|
5
docs/changelog/84827.yaml
Normal file
5
docs/changelog/84827.yaml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
pr: 84827
|
||||||
|
summary: Do not send default ignore_throttled parameter since it is deprecated
|
||||||
|
area: Java High Level REST Client
|
||||||
|
type: bug
|
||||||
|
issues: []
|
Loading…
Add table
Add a link
Reference in a new issue