fix-get-stat
All checks were successful
Deploy on push / deploy (push) Successful in 26s

This commit is contained in:
2024-05-18 15:40:15 +03:00
parent 306caf9520
commit 5fe51e03bb
2 changed files with 16 additions and 11 deletions

View File

@@ -138,13 +138,17 @@ class SearchService:
result = json.loads(result)
if isinstance(result, dict):
mapping = result.get(self.index_name, {}).get("mappings")
logger.debug(f"Найдена структура индексации: {mapping['properties'].keys()}")
logger.debug(
f"Найдена структура индексации: {mapping['properties'].keys()}"
)
if (
mapping
and mapping["properties"].keys()
!= expected_mapping["properties"].keys()
):
logger.debug(f"Ожидаемая структура индексации: {expected_mapping}")
logger.debug(
f"Ожидаемая структура индексации: {expected_mapping}"
)
logger.warn("[!!!] Требуется переиндексация всех данных")
self.delete_index()
self.client = None