Skip to content

Added param ignore_throttled=false when indicesOptions.ignoreThrottle… #42393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,7 @@ Params withIndicesOptions(IndicesOptions indicesOptions) {
expandWildcards = joiner.toString();
}
putParam("expand_wildcards", expandWildcards);
putParam("ignore_throttled", Boolean.toString(indicesOptions.ignoreThrottled()));
}
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1561,7 +1561,7 @@ public void testFieldCaps() {
endpoint.add("_field_caps");

assertEquals(endpoint.toString(), request.getEndpoint());
assertEquals(4, request.getParameters().size());
assertEquals(5, request.getParameters().size());

// Note that we don't check the field param value explicitly, as field names are
// passed through
Expand Down Expand Up @@ -1595,7 +1595,7 @@ public void testRankEval() throws Exception {
}
endpoint.add(RestRankEvalAction.ENDPOINT);
assertEquals(endpoint.toString(), request.getEndpoint());
assertEquals(3, request.getParameters().size());
assertEquals(4, request.getParameters().size());
assertEquals(expectedParams, request.getParameters());
assertToXContentBody(spec, request.getEntity());
}
Expand Down Expand Up @@ -1922,7 +1922,8 @@ static void setRandomIndicesOptions(Consumer<IndicesOptions> setter, Supplier<In
Map<String, String> expectedParams) {

if (randomBoolean()) {
setter.accept(IndicesOptions.fromOptions(randomBoolean(), randomBoolean(), randomBoolean(), randomBoolean()));
setter.accept(IndicesOptions.fromOptions(randomBoolean(), randomBoolean(), randomBoolean(), randomBoolean(),
true, false, false, randomBoolean()));
}
expectedParams.put("ignore_unavailable", Boolean.toString(getter.get().ignoreUnavailable()));
expectedParams.put("allow_no_indices", Boolean.toString(getter.get().allowNoIndices()));
Expand All @@ -1935,11 +1936,13 @@ static void setRandomIndicesOptions(Consumer<IndicesOptions> setter, Supplier<In
} else {
expectedParams.put("expand_wildcards", "none");
}
expectedParams.put("ignore_throttled", Boolean.toString(getter.get().ignoreThrottled()));
}

static IndicesOptions setRandomIndicesOptions(IndicesOptions indicesOptions, Map<String, String> expectedParams) {
if (randomBoolean()) {
indicesOptions = IndicesOptions.fromOptions(randomBoolean(), randomBoolean(), randomBoolean(), randomBoolean());
indicesOptions = IndicesOptions.fromOptions(randomBoolean(), randomBoolean(), randomBoolean(), randomBoolean(),
true, false, false, randomBoolean());
}
expectedParams.put("ignore_unavailable", Boolean.toString(indicesOptions.ignoreUnavailable()));
expectedParams.put("allow_no_indices", Boolean.toString(indicesOptions.allowNoIndices()));
Expand All @@ -1952,6 +1955,7 @@ static IndicesOptions setRandomIndicesOptions(IndicesOptions indicesOptions, Map
} else {
expectedParams.put("expand_wildcards", "none");
}
expectedParams.put("ignore_throttled", Boolean.toString(indicesOptions.ignoreThrottled()));
return indicesOptions;
}

Expand Down