mj_plan tested
This commit is contained in:
@@ -135,6 +135,19 @@ def import_paln_json_to_elastic(elastic, file_path, index_name):
|
|||||||
# print(':D')
|
# print(':D')
|
||||||
|
|
||||||
|
|
||||||
|
def list_json_files(directory):
|
||||||
|
import os
|
||||||
|
json_files = []
|
||||||
|
|
||||||
|
# مرور در دایرکتوری
|
||||||
|
for root, _, files in os.walk(directory):
|
||||||
|
for file in files:
|
||||||
|
if file.endswith('.json'):
|
||||||
|
# افزودن مسیر کامل فایل به لیست
|
||||||
|
json_files.append(os.path.join(root, file))
|
||||||
|
|
||||||
|
return json_files
|
||||||
|
|
||||||
|
|
||||||
# -------------------------------------------------------------------- Run
|
# -------------------------------------------------------------------- Run
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
@@ -155,11 +168,14 @@ if __name__ == "__main__":
|
|||||||
path_base_map = "G:/Project2/gateway2_main/repo/_other/"
|
path_base_map = "G:/Project2/gateway2_main/repo/_other/"
|
||||||
elastic = ElasticHelper(host, password, "elastic", path_base_map)
|
elastic = ElasticHelper(host, password, "elastic", path_base_map)
|
||||||
|
|
||||||
file_path=r'data/plans/gpt120b_49_1/data_1/آمار، برنامه و بودجه.json'
|
|
||||||
index_name='mj_plan'
|
index_name='mj_plan'
|
||||||
|
# file_path=r'data/plans/gpt120b_49_1/data_1/آمار، برنامه و بودجه.json'
|
||||||
|
file_path=r'data/plans/gpt120b_49_1/data_1/'
|
||||||
|
|
||||||
|
for file in list_json_files(file_path):
|
||||||
import_paln_json_to_elastic(
|
import_paln_json_to_elastic(
|
||||||
elastic=elastic,
|
elastic=elastic,
|
||||||
file_path=file_path,
|
file_path=file,
|
||||||
index_name=index_name
|
index_name=index_name
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user