majles update end
This commit is contained in:
@@ -71,11 +71,11 @@ elastic = ElasticHelper(host, password, "elastic", path_base_map)
|
||||
# ----- حذف فیزیکی mj_qa_qanon
|
||||
#DELETE mj_qa_qanon
|
||||
|
||||
file_path = "G:/Project2/160_dotic/majles_14040918/mj_qa_qanon.zip"
|
||||
file_path = "G:/Project2/160_dotic/majles_14040926/mj_qa_qanon.zip"
|
||||
index_name = "mj_qa_qanon"
|
||||
|
||||
#elastic.createIndex( 'mj_qa_qanon', 'majles', 'mj_qa_qanon', path_base_map+ 'majles/'+'mj_qa_qanon_new.json' )
|
||||
#restore_correct_date_to_elastic(elastic, file_path, index_name, "G:/Project2/160_dotic/date_log_error_qaqanon.txt" )
|
||||
# elastic.createIndex( 'mj_qa_qanon', 'majles', 'mj_qa_qanon', path_base_map+ 'majles/'+'mj_qa_qanon.json' )
|
||||
# restore_correct_date_to_elastic(elastic, file_path, index_name, "G:/Project2/160_dotic/date_log_error_qaqanon.txt" )
|
||||
|
||||
|
||||
# -------------------------------------
|
||||
@@ -84,10 +84,10 @@ index_name = "mj_qa_qanon"
|
||||
# ----- حذف فیزیکی mj_df_qanon
|
||||
#DELETE mj_df_qanon
|
||||
|
||||
file_path = "G:/Project2/160_dotic/majles_14040918/mj_df_qanon.zip"
|
||||
file_path = "G:/Project2/160_dotic/majles_14040926/mj_df_qanon.zip"
|
||||
index_name = "mj_df_qanon"
|
||||
|
||||
# elastic.createIndex( 'mj_df_qanon', 'majles', 'mj_df_qanon', path_base_map+ 'majles/'+'mj_df_qanon_new.json' )
|
||||
# elastic.createIndex( 'mj_df_qanon', 'majles', 'mj_df_qanon', path_base_map+ 'majles/'+'mj_df_qanon.json' )
|
||||
# restore_correct_date_to_elastic(elastic, file_path, index_name, "G:/Project2/160_dotic/date_log_error_dfqanon.txt" )
|
||||
|
||||
|
||||
@@ -98,19 +98,32 @@ index_name = "mj_df_qanon"
|
||||
# ----- حذف فیزیکی mj_qa_section
|
||||
#DELETE mj_qa_section
|
||||
|
||||
file_path = "G:/Project2/160_dotic/majles_14040918/mj_qa_section.zip"
|
||||
file_path = "G:/Project2/160_dotic/majles_14040926/mj_qa_section.zip"
|
||||
index_name = "mj_qa_section"
|
||||
|
||||
# elastic.createIndex( 'mj_qa_section', 'majles', 'mj_qa_section', path_base_map+ 'majles/'+'mj_qa_section_new.json' )
|
||||
# elastic.createIndex( 'mj_qa_section', 'majles', 'mj_qa_section', path_base_map+ 'majles/'+'mj_qa_section.json' )
|
||||
# restore_correct_date_to_elastic(elastic, file_path, index_name, "G:/Project2/160_dotic/date_log_error_qasection.txt" )
|
||||
|
||||
|
||||
# # ---فقط برای یک بار
|
||||
# # ---- حذف یک مورد اشتباه با عنوان خالی
|
||||
# # POST mj_qa_section/_delete_by_query
|
||||
# # {
|
||||
# # "query": {
|
||||
# # "term": {
|
||||
# # "qanon_id": {
|
||||
# # "value": "df_6914887106dba"
|
||||
# # }
|
||||
# # }
|
||||
# # }
|
||||
# # }
|
||||
|
||||
# -------------------------------------
|
||||
# ----- mj_rg_section
|
||||
|
||||
file_path = "G:/Project2/160_dotic/mj_rg_section_doctic_14040824.zip"
|
||||
|
||||
# elastic.createIndex( 'mj_rg_section', 'majles', 'mj_rg_section', path_base_map+ 'majles/'+'mj_qa_section_new.json')
|
||||
# elastic.createIndex( 'mj_rg_section', 'majles', 'mj_rg_section', path_base_map+ 'majles/'+'mj_qa_section.json')
|
||||
# restore_correct_date_to_elastic(elastic, file_path, "mj_rg_section", "G:/Project2/160_dotic/date_log_error_rgsection.txt" )
|
||||
|
||||
|
||||
@@ -121,8 +134,8 @@ file_path = "G:/Project2/160_dotic/mj_rg_section_doctic_14040824.zip"
|
||||
|
||||
file_path = "G:/Project2/160_dotic/mj_mashruh.zip"
|
||||
# elastic.backupIndexToZipfile("G:/Project2/160_dotic", "mj_mashruh", "mj_mashruh")
|
||||
elastic.createIndex( 'mj_mashruh', 'majles', 'mj_mashruh', path_base_map+ 'majles/'+'mj_mashruh.json' )
|
||||
restore_correct_date_to_elastic(elastic, file_path, "mj_mashruh", "G:/Project2/160_dotic/date_log_error_mashruh.txt" )
|
||||
# elastic.createIndex( 'mj_mashruh', 'majles', 'mj_mashruh', path_base_map+ 'majles/'+'mj_mashruh.json' )
|
||||
# restore_correct_date_to_elastic(elastic, file_path, "mj_mashruh", "G:/Project2/160_dotic/date_log_error_mashruh.txt" )
|
||||
|
||||
|
||||
|
||||
@@ -139,8 +152,8 @@ restore_correct_date_to_elastic(elastic, file_path, "mj_mashruh", "G:/Project2/1
|
||||
|
||||
# ctx._source.main_type = 'قانون'
|
||||
# """,
|
||||
# "lang": "painless",
|
||||
# },
|
||||
# "lang": "painless"
|
||||
# }
|
||||
# }
|
||||
# elastic.updateByQueryIndex("mj_qa_qanon", body)
|
||||
|
||||
@@ -154,8 +167,8 @@ restore_correct_date_to_elastic(elastic, file_path, "mj_mashruh", "G:/Project2/1
|
||||
# ctx._source.sub_type = ctx._source.main_type;
|
||||
# ctx._source.main_type = 'قانون'
|
||||
# """,
|
||||
# "lang": "painless",
|
||||
# },
|
||||
# "lang": "painless"
|
||||
# }
|
||||
# }
|
||||
# elastic.updateByQueryIndex("mj_qa_qanon", body)
|
||||
|
||||
@@ -190,7 +203,7 @@ restore_correct_date_to_elastic(elastic, file_path, "mj_mashruh", "G:/Project2/1
|
||||
# elastic.updateByQueryIndex("mj_df_qanon", body)
|
||||
|
||||
|
||||
#elastic.backupIndexToZipfile("G:/Project2/160_dotic/majles_14040918", "mj_df_qanon", "mj_df_qanon_1_date")
|
||||
# elastic.backupIndexToZipfile("G:/Project2/160_dotic/majles_14040926", "mj_df_qanon", "mj_df_qanon_1_date")
|
||||
|
||||
|
||||
# --------------------------------------------- 3 ------------------------------------------------------------------
|
||||
@@ -198,32 +211,37 @@ restore_correct_date_to_elastic(elastic, file_path, "mj_mashruh", "G:/Project2/1
|
||||
# ---------------------------------------------------------------------------------------------------------------
|
||||
|
||||
# --- موقت
|
||||
# elastic.backupIndexToZipfile("G:/Project2/160_dotic", "mj_qa_qanon", "mj_qa_qanon_1_date")
|
||||
# elastic.backupIndexToZipfile("G:/Project2/160_dotic/majles_14040926", "mj_qa_qanon", "mj_qa_qanon_1_date")
|
||||
|
||||
|
||||
# -- حذف مقرره های قبلی
|
||||
body = {"query": {"term": {"main_type": {"value": "مقرره"}}}}
|
||||
# body = {"query": {"term": {"main_type": {"value": "مقرره"}}}}
|
||||
# elastic.deleteByQueryIndex("mj_qa_qanon", body)
|
||||
|
||||
# --- موقت
|
||||
#elastic.backupIndexToZipfile("G:/Project2/160_dotic", "mj_qa_qanon", "mj_qa_qanon_2_base")
|
||||
# elastic.backupIndexToZipfile("G:/Project2/160_dotic/majles_14040926", "mj_qa_qanon", "mj_qa_qanon_2_base")
|
||||
# -------------------------------------
|
||||
# -------------------------------------
|
||||
|
||||
# --- درج داده های جدید مقرره
|
||||
# import_data_new_qaqanon(elastic, "G:/Project2/160_dotic/mj_qa_qanon_doctic_14040824.zip")
|
||||
|
||||
# import_data_new_qaqanon(elastic, "G:/Project2/160_dotic/dotic_14040824/mj_qa_qanon_doctic_14040824.zip")
|
||||
|
||||
# -------------------------------------
|
||||
# ----- انتقال داده های آراء به
|
||||
#### بخاطر لزوم تغییر روش کار، لازم شد محتوای آراء به اینجا منتفل شود
|
||||
#### البته بقیه فراداده قبلا منتقل شده بودند
|
||||
# file_path = 'G:/Project2/160_dotic/mj_qa_opinion_doctic_14040824.zip'
|
||||
# index_name = "mj_qa_qanon"
|
||||
# import_content_opinion_to_qaqanon(elastic, file_path, index_name )
|
||||
#--- بخاطر لزوم تغییر روش کار، لازم شد محتوای آراء به اینجا منتفل شود
|
||||
#--- البته بقیه فراداده قبلا منتقل شده بودند
|
||||
|
||||
file_path = 'G:/Project2/160_dotic/dotic_14040824/mj_qa_opinion_doctic_14040824.zip'
|
||||
# import_content_opinion_to_qaqanon(elastic, file_path, "mj_qa_qanon" )
|
||||
|
||||
|
||||
# # -------------------------------------
|
||||
# # ----- انتقال داده های مشروح مذاکرات به فهرست همه قوانین
|
||||
# ??????فعلا انجام نشده # file_path = 'G:/Project2/160_dotic/mj_mashruh.zip'
|
||||
|
||||
|
||||
# --- موقت
|
||||
# elastic.backupIndexToZipfile("G:/Project2/160_dotic", "mj_qa_qanon", "mj_qa_qanon_3_base_dotic")
|
||||
# elastic.backupIndexToZipfile("G:/Project2/160_dotic/majles_14040926", "mj_qa_qanon", "mj_qa_qanon_3_base_dotic")
|
||||
|
||||
# --------------------------------------------- 4 ------------------------------------------------------------------
|
||||
# ---------------------------------------------------------------------------------------------------------------
|
||||
@@ -231,8 +249,6 @@ file_before = "G:/Project2/160_dotic/duplicate_before.json"
|
||||
file_after = "G:/Project2/160_dotic/duplicate_after.json"
|
||||
file_tasmim = "G:/Project2/160_dotic/duplicate_tasmim.json"
|
||||
|
||||
# elastic.createIndex( 'mj_qa_qanon', 'majles', 'mj_qa_qanon', path_base_map+ 'majles/'+'mj_qa_qanon_new.json' )
|
||||
# elastic.restorFileToElastic2('G:/Project2/160_dotic/mj_qa_qanon_3_base_dotic.zip', 'mj_qa_qanon', 'majles', False, 'mj_qa_qanon')
|
||||
|
||||
# # #------------------------------------------
|
||||
# duplicate_list = {}
|
||||
@@ -265,7 +281,7 @@ file_tasmim = "G:/Project2/160_dotic/duplicate_tasmim.json"
|
||||
|
||||
|
||||
# # --- موقت
|
||||
# elastic.backupIndexToZipfile("G:/Project2/160_dotic", "mj_qa_qanon", "mj_qa_qanon_4_base_excel")
|
||||
#elastic.backupIndexToZipfile("G:/Project2/160_dotic/majles_14040926", "mj_qa_qanon", "mj_qa_qanon_4_base_excel")
|
||||
|
||||
|
||||
#---------تنظیم شد mj_qa_qanon_new.json
|
||||
@@ -290,13 +306,13 @@ file_tasmim = "G:/Project2/160_dotic/duplicate_tasmim.json"
|
||||
#------------------------------------
|
||||
#--- mj_qa_section
|
||||
|
||||
# elastic.backupIndexToZipfile("G:/Project2/160_dotic", "mj_qa_section", "mj_qa_section_1_base")
|
||||
#elastic.backupIndexToZipfile("G:/Project2/160_dotic/majles_14040926", "mj_qa_section", "mj_qa_section_1_base")
|
||||
|
||||
# بررسی پر بودن main_type مجلس برای نوع اصلی/تبعی/مهذب # و تغییر به mom_type
|
||||
#### schema changed --> qasection_mom_type
|
||||
|
||||
|
||||
# # # POST mj_qa_section/_update_by_query
|
||||
# # POST mj_qa_section/_update_by_query
|
||||
# body = {
|
||||
# "query": {"terms": {"main_type": ["اصلی", "تبعی"]}},
|
||||
# "script": {
|
||||
@@ -305,12 +321,30 @@ file_tasmim = "G:/Project2/160_dotic/duplicate_tasmim.json"
|
||||
# ctx._source.mom_type = ctx._source.main_type;
|
||||
# ctx._source.main_type = 'قانون'
|
||||
# """,
|
||||
# "lang": "painless",
|
||||
# },
|
||||
# "lang": "painless"
|
||||
# }
|
||||
# }
|
||||
# elastic.updateByQueryIndex("mj_qa_section", body)
|
||||
|
||||
#-------------------------------------------------------------------------------------------------
|
||||
#-------------------------------------------------------------------------------------------------
|
||||
#--- پشتیبان گیری نهایی برای انتقال
|
||||
|
||||
# elastic.backupIndexToZipfile("G:/Project2/160_dotic", "mj_mashruh", "mj_mashruh")
|
||||
# elastic.backupIndexToZipfile("G:/Project2/160_dotic", "mj_qa_qanon", "mj_qa_qanon")
|
||||
# elastic.backupIndexToZipfile("G:/Project2/160_dotic", "mj_df_qanon", "mj_df_qanon")
|
||||
# elastic.backupIndexToZipfile("G:/Project2/160_dotic", "mj_qa_section", "mj_qa_section")
|
||||
# elastic.backupIndexToZipfile("G:/Project2/160_dotic", "mj_rg_section", "mj_rg_section")
|
||||
|
||||
#-------------------------------------------------------------------------------------------------
|
||||
#-------------------------------------------------------------------------------------------------
|
||||
#-------------------------------------------------------------------------------------------------
|
||||
|
||||
# elastic.createIndex( 'mj_qa_section-m1', 'majles', 'mj_qa_section', path_base_map+ 'majles/'+'mj_qa_section.json' )
|
||||
# elastic.restorFileToElastic2('G:/Project2/160_dotic/mj_qa_section-m1.zip', 'mj_qa_section-m1', 'majles', False)
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
# elastic.backupIndexToZipfile("G:/Project2/160_dotic", "mj_mashruh", "mj_mashruh")
|
||||
@@ -318,21 +352,26 @@ file_tasmim = "G:/Project2/160_dotic/duplicate_tasmim.json"
|
||||
# elastic.restorFileToElastic2('G:/Project2/160_dotic/mj_mashruh.zip', 'mj_mashruh', 'majles', False, 'mj_mashruh')
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# elastic.createIndex( 'mj_qa_qanon', 'majles', 'mj_qa_qanon')
|
||||
# elastic.restorFileToElastic2('G:/Project2/160_dotic/mj_qa_qanon_base_excel.zip', 'mj_qa_qanon', 'majles', False, 'mj_qa_qanon')
|
||||
|
||||
|
||||
# elastic.createIndex( 'mj_qa_qanon', 'majles', 'mj_qa_qanon', path_base_map+ 'majles/'+'mj_qa_qanon_new.json' )
|
||||
# elastic.restorFileToElastic2('G:/Project2/160_dotic/majles_14040918/mj_qa_qanon_4_base_excel.zip', 'mj_qa_qanon', 'majles', False, 'mj_qa_qanon')
|
||||
# elastic.createIndex( 'mj_qa_section', 'majles', 'mj_qa_section', path_base_map+ 'majles/'+'mj_qa_section.json' )
|
||||
# elastic.restorFileToElastic2('G:/Project2/160_dotic/mj_qa_section.zip', 'mj_qa_section', 'majles', False, 'mj_qa_section')
|
||||
|
||||
|
||||
# elastic.createIndex( 'mj_df_qanon', 'majles', 'mj_df_qanon', path_base_map+ 'majles/'+'mj_df_qanon_new.json' )
|
||||
# elastic.restorFileToElastic2('G:/Project2/160_dotic/majles_14040918/mj_df_qanon_1_date.zip', 'mj_df_qanon', 'majles', False, 'mj_df_qanon')
|
||||
# elastic.createIndex( 'mj_df_qanon', 'majles', 'mj_df_qanon', path_base_map+ 'majles/'+'mj_df_qanon.json' )
|
||||
# elastic.restorFileToElastic2('G:/Project2/160_dotic/majles_14040926/mj_df_qanon_1_date.zip', 'mj_df_qanon', 'majles', False, 'mj_df_qanon')
|
||||
|
||||
# elastic.createIndex( 'mj_qa_qanon', 'majles', 'mj_qa_qanon', path_base_map+ 'majles/'+'mj_qa_qanon.json' )
|
||||
# elastic.restorFileToElastic2('G:/Project2/160_dotic/mj_qa_qanon_3_base_dotic.zip', 'mj_qa_qanon', 'majles', False, 'mj_qa_qanon')
|
||||
|
||||
|
||||
# elastic.backupIndexToZipfile("G:/Project2/160_dotic", "mj_qa_semantic_section", "mj_qa_semantic_section")
|
||||
|
||||
|
||||
|
||||
|
||||
# elastic.backupIndexToZipfile("G:/Project2/160_dotic", "mj_mashruh", "mj_mashruh")
|
||||
# elastic.backupIndexToZipfile("G:/Project2/160_dotic", "mj_qa_section", "mj_qa_section")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user