mirror of
https://github.com/tubearchivist/tubearchivist
synced 2024-11-02 09:41:07 +00:00
fix index validate_mappings for new nested object
This commit is contained in:
parent
9537c388ab
commit
a0ed88580f
@ -54,14 +54,15 @@ class ElasticIndex:
|
|||||||
|
|
||||||
def validate_mappings(self):
|
def validate_mappings(self):
|
||||||
"""check if all mappings are as expected"""
|
"""check if all mappings are as expected"""
|
||||||
|
|
||||||
expected_map = self.expected_map
|
|
||||||
now_map = self.details["mappings"]["properties"]
|
now_map = self.details["mappings"]["properties"]
|
||||||
|
|
||||||
for key, value in expected_map.items():
|
for key, value in self.expected_map.items():
|
||||||
# nested
|
# nested
|
||||||
if list(value.keys()) == ["properties"]:
|
if list(value.keys()) == ["properties"]:
|
||||||
for key_n, value_n in value["properties"].items():
|
for key_n, value_n in value["properties"].items():
|
||||||
|
if key not in now_map:
|
||||||
|
print(key_n, value_n)
|
||||||
|
return True
|
||||||
if key_n not in now_map[key]["properties"].keys():
|
if key_n not in now_map[key]["properties"].keys():
|
||||||
print(key_n, value_n)
|
print(key_n, value_n)
|
||||||
return True
|
return True
|
||||||
|
Loading…
Reference in New Issue
Block a user