Skip to content

Commit ea6c909

Browse files
committed
Pass prefix when flattening index settings
A bug that manifests itself if index settings are more than 1 level deep.
1 parent 15f70d3 commit ea6c909

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Nest/IndexModules/IndexSettings/Settings/IndexSettingsConverter.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ public JObject Flatten(JObject original, string prefix = "", JObject newObject =
9595
newObject = newObject ?? new JObject();
9696
foreach (var property in original.Properties())
9797
{
98-
if (property.Value is JObject && property.Name != "analysis") Flatten(property.Value.Value<JObject>(), property.Name + ".", newObject);
98+
if (property.Value is JObject && property.Name != "analysis")
99+
Flatten(property.Value.Value<JObject>(), prefix + property.Name + ".", newObject);
99100
else newObject.Add(prefix + property.Name, property.Value);
100101
}
101102
return newObject;
@@ -214,4 +215,4 @@ private static void Set<T>(IIndexSettings s, IDictionary<string, JProperty> sett
214215
settings.Remove(key);
215216
}
216217
}
217-
}
218+
}

0 commit comments

Comments
 (0)