refactor
This commit is contained in:
+32
-17
@@ -7,15 +7,20 @@ from elastic_helper import ElasticHelper
|
||||
from create_relation_tags import *
|
||||
from temp_refactor_gn_dataset import *
|
||||
|
||||
from temp_LawSection_content import *
|
||||
|
||||
# cursor, cnxn = create_cursor()
|
||||
# import_law_section_to_elastic(cursor)
|
||||
|
||||
|
||||
load_dotenv(dotenv_path='config.env')
|
||||
|
||||
|
||||
# host=os.getenv('HOST_160')
|
||||
# password=os.getenv('HOST_160_PASS')
|
||||
host=os.getenv('HOST_160')
|
||||
password=os.getenv('HOST_160_PASS')
|
||||
|
||||
host=os.getenv('HOST_112')
|
||||
password=os.getenv('HOST_112_PASS')
|
||||
# host=os.getenv('HOST_112')
|
||||
# password=os.getenv('HOST_112_PASS')
|
||||
|
||||
# host=os.getenv('HOST_60')
|
||||
# password=os.getenv('HOST_60_PASS')
|
||||
@@ -27,19 +32,18 @@ print(host)
|
||||
path_base_map = "G:/Project2/gateway2_main/repo/_other/"
|
||||
elastic = ElasticHelper(host, password, "elastic", path_base_map)
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
##
|
||||
# elastic.backupIndexToZipfile("G:/Project2/111", "gn_dataset")
|
||||
#moveDataset1(elastic, "G:/Project2/111/gn_dataset_14031125.zip", "gn_dataset2")
|
||||
#-------------------------------------------------------
|
||||
##
|
||||
|
||||
#elastic.backupIndexToZipfile("G:/Project2/111", "gn_dataset")
|
||||
|
||||
moveDataset1(elastic, "G:/Project2/111/gn_dataset_14031125.zip", "gn_dataset")
|
||||
|
||||
|
||||
## کد نمونه بازیابی از فایل
|
||||
#path_back = 'G:/Project2/111'
|
||||
#elastic.restorFileToElastic(path_back, 'gn_dataset_14031125.zip', 'majles', True, 'mj_qa_section')
|
||||
# ## کد نمونه بازیابی از فایل
|
||||
# path_back = 'G:/Project2/111/gn_dataset_14031125.zip'
|
||||
# elastic.createIndex('gn_dataset')
|
||||
# elastic.zipFileToElastic(path_back, 'gn_dataset')
|
||||
|
||||
|
||||
|
||||
@@ -47,10 +51,6 @@ moveDataset1(elastic, "G:/Project2/111/gn_dataset_14031125.zip", "gn_dataset")
|
||||
#elastic.backupIndexToZipfile("G:/Project2/111", "mj_qa_section_ai")
|
||||
#elastic.restorFileToElastic("G:/Project2/111", "mj_qa_section_ai", 'majles', True, "mj_qa_section")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
#### فایده ای نداشت ....!!!
|
||||
## مسیر درختی مفید تولید نشد و عنوان قانون هم که فیلد مجزا داریم !
|
||||
@@ -88,6 +88,21 @@ moveDataset1(elastic, "G:/Project2/111/gn_dataset_14031125.zip", "gn_dataset")
|
||||
#-------------------------------------------------------
|
||||
##
|
||||
|
||||
## پشتیبان گیری
|
||||
|
||||
# path_back = os.getcwd() + '/data_back'
|
||||
#path_back = 'G:/Project2/111'
|
||||
# if not os.path.exists(path_back) :
|
||||
# os.makedirs(path_back)
|
||||
# print('---> path_back = ' + path_back)
|
||||
|
||||
#elastic.backupIndexToZipfile(path_back, "mj_qa_qanon")
|
||||
# elastic.backupIndexToZipfile(path_back, "mj_qa_section")
|
||||
# elastic.backupIndexToZipfile(path_back, "mj_qa_section", '', {}, True, [], ["pos_tags", "chunk_tags", "version_info"])
|
||||
#elastic.backupIndexToZipfile(path_back, "mj_qa_section_ai")
|
||||
#elastic.backupIndexToZipfile(path_back, "mj_rg_section")
|
||||
#elastic.backupIndexToZipfile(path_back, "mj_qa_opinion")
|
||||
|
||||
## کد نمونه بازیابی از فایل
|
||||
# path_back = 'G:/Project2/_back/back_data/data_majles/elastic/v1.0/full'
|
||||
# elastic.restorFileToElastic(path_back, 'mj_qa_section', 'majles')
|
||||
|
||||
Reference in New Issue
Block a user