Skip to content

Commit

Permalink
Allow system index warning
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <cwperx@amazon.com>
  • Loading branch information
cwperks committed Jul 3, 2024
1 parent e82b432 commit 05d30cd
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -708,11 +708,14 @@ protected void refreshAllIndices() throws IOException {
requestOptions.setWarningsHandler(warnings -> {
if (warnings.isEmpty()) {
return false;
} else if (warnings.size() > 1) {
return true;
} else {
return warnings.get(0).startsWith("this request accesses system indices:") == false;
}
boolean allSystemIndexWarning = true;
for (String warning : warnings) {
if (!warning.startsWith("this request accesses system indices:")) {
allSystemIndexWarning = false;
}
}
return !allSystemIndexWarning;
});
refreshRequest.setOptions(requestOptions);
client().performRequest(refreshRequest);
Expand Down

0 comments on commit 05d30cd

Please sign in to comment.