Skip to content
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 @@ -1111,6 +1111,7 @@ private Set<String> innerResolve(Context context, List<String> expressions, Indi
String expression = expressions.get(i);
if (Strings.isEmpty(expression)) {
context.addResolutionError(indexNotFoundException(expression));
continue;
}
validateAliasOrIndex(context, expression);
if (aliasOrIndexExists(context, options, metadata, expression)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2112,6 +2112,22 @@ public void testInvalidIndex() {
assertEquals("Invalid index name [_foo], must not start with '_'.", iine.getMessage());
}

public void testInvalidEmptyIndex() {
Metadata.Builder mdBuilder = Metadata.builder().put(indexBuilder("test"));
ClusterState state = ClusterState.builder(new ClusterName("_name")).metadata(mdBuilder).build();
IndexNameExpressionResolver.Context context = new IndexNameExpressionResolver.Context(
state,
IndicesOptions.lenientExpandOpen(),
false
);

IndexNotFoundException indexNotFoundException = expectThrows(
IndexNotFoundException.class,
() -> indexNameExpressionResolver.concreteIndexNames(context, "")
);
assertEquals("no such index []", indexNotFoundException.getMessage());
}

public void testIgnoreThrottled() {
Metadata.Builder mdBuilder = Metadata.builder()
.put(
Expand Down
Loading