import majles...
This commit is contained in:
@@ -349,7 +349,7 @@ class ElasticHelper:
|
||||
# - دادهها را از فایل ZIP به Elasticsearch بازیابی میکند
|
||||
# -----------------------------end----------------------------
|
||||
def restorFileToElastic(
|
||||
self, path_back, index_name, app_key="", queryDelete=True, map_name=""
|
||||
self, path_back, index_name, app_key="", queryDelete=True, map_name="", mapping_file_path = ""
|
||||
):
|
||||
if not os.path.exists(path_back):
|
||||
print(" **** error *** path not exist: ", path_back)
|
||||
@@ -362,14 +362,14 @@ class ElasticHelper:
|
||||
if queryDelete:
|
||||
# اگر وجود داشته باشد، از کاربر برای حذفش سوال میکند
|
||||
if self.deleteIndex(index_name):
|
||||
self.createIndex(index_name, app_key, map_name)
|
||||
self.createIndex(index_name, app_key, map_name, mapping_file_path)
|
||||
self.zipFileToElastic(file_path, index_name)
|
||||
else: # اگر وجود داشته باشد پرش می کند و کاری نمیکند
|
||||
self.createIndex(index_name, app_key, map_name)
|
||||
self.createIndex(index_name, app_key, map_name, mapping_file_path)
|
||||
self.zipFileToElastic(file_path, index_name)
|
||||
|
||||
def restorFileToElastic2(
|
||||
self, path_file, index_name, app_key="", queryDelete=True, map_name=""
|
||||
self, path_file, index_name, app_key="", queryDelete=True, map_name="", mapping_file_path = ""
|
||||
):
|
||||
if not os.path.exists(path_file):
|
||||
print(" **** error *** path not exist: ", path_file)
|
||||
@@ -382,10 +382,10 @@ class ElasticHelper:
|
||||
if queryDelete:
|
||||
# اگر وجود داشته باشد، از کاربر برای حذفش سوال میکند
|
||||
if self.deleteIndex(index_name):
|
||||
self.createIndex(index_name, app_key, map_name)
|
||||
self.createIndex(index_name, app_key, map_name, mapping_file_path)
|
||||
self.zipFileToElastic(file_path, index_name)
|
||||
else: # اگر وجود داشته باشد پرش می کند و کاری نمیکند
|
||||
self.createIndex(index_name, app_key, map_name)
|
||||
self.createIndex(index_name, app_key, map_name, mapping_file_path)
|
||||
self.zipFileToElastic(file_path, index_name)
|
||||
|
||||
# ----------------------------start---------------------------
|
||||
|
||||
Reference in New Issue
Block a user