perf: Improve performance by optimizing ES index creation

This commit is contained in:
wangruidong
2024-08-16 15:39:28 +08:00
committed by Bryan
parent 6aa1227e60
commit df9cc4700b

View File

@@ -190,7 +190,8 @@ class ES(object):
mappings['aliases'] = {
self.query_index: {}
}
if self.es.indices.exists(index=self.index):
return
try:
self.es.indices.create(index=self.index, body=mappings)
except (RequestError, BadRequestError) as e: