ImmutableSettings.Builder dynamicSettings = ImmutableSettings.builder();
for (Map.Entry<String, String> e : settings.getAsMap().entrySet()) {
if (indexDynamicSettings.hasDynamicSetting(e.getKey())) {
String error = indexDynamicSettings.validateDynamicSetting(e.getKey(), e.getValue());
if (error == null) {
dynamicSettings.put(e.getKey(), e.getValue());
} else {
// TODO better error handling
throw new IllegalArgumentException("index setting " + e.getKey() + " has invalid value '"