If types and index mappings are empty consider the mapping as an "empty" mapping and return status 200.

This commit is contained in:
Henrik Lindström 2012-10-04 17:17:36 +02:00 committed by Shay Banon
parent 2c150419ce
commit 4d969add80
1 changed files with 5 additions and 0 deletions

View File

@ -117,6 +117,11 @@ public class RestGetMappingAction extends BaseRestHandler {
builder.map(mappingMd.sourceAsMap());
}
if (indexMetaData.mappings().values().isEmpty() && types.isEmpty()) {
// if no types are specified and no mappings are set for the index, consider this an empty mapping
foundAny = true;
}
builder.endObject();
}
}