only return 404 on actual index settings missing, on "_all", return 200

relates to #2676
This commit is contained in:
Shay Banon 2013-02-22 23:08:00 +01:00
parent 915019587d
commit eea3a01765
1 changed files with 2 additions and 3 deletions

View File

@ -72,9 +72,8 @@ public class RestGetSettingsAction extends BaseRestHandler {
try {
MetaData metaData = response.getState().metaData();
if (metaData.indices().isEmpty()) {
String indexName = indices.length == 0 ? "_all" : indices[0];
channel.sendResponse(new XContentThrowableRestResponse(request, new IndexMissingException(new Index(indexName))));
if (metaData.indices().isEmpty() && indices.length > 0) {
channel.sendResponse(new XContentThrowableRestResponse(request, new IndexMissingException(new Index(indices[0]))));
return;
}