fix: 修复es7创建index的错误

This commit is contained in:
fangfang.dong 2023-07-31 14:54:35 +08:00
parent bf30be2084
commit 47dd73eb4c

View File

@ -131,7 +131,10 @@ class ES(object):
} }
try: try:
self.es.indices.create(self.index, body=mappings) if version == '6':
self.es.indices.create(self.index, body=mappings)
else:
self.es.indices.create(index=self.index, body=mappings)
except RequestError as e: except RequestError as e:
if e.error == 'resource_already_exists_exception': if e.error == 'resource_already_exists_exception':
logger.warning(e) logger.warning(e)