move tanghih codes
This commit is contained in:
+54
-2
@@ -74,10 +74,61 @@ elastic = ElasticHelper(host, password, "elastic", path_base_map)
|
||||
# elastic.createIndex('mj_qa_section', 'majles', 'mj_qa_section')
|
||||
# elastic.zipFileToElastic(path_back, 'mj_qa_section')
|
||||
|
||||
elastic.backupIndexToZipfile("G:/Project2/111", "mj_qa_section")
|
||||
# elastic.backupIndexToZipfile("G:/Project2/111", "gn_log_action")
|
||||
|
||||
# elastic.backupIndexToZipfile("G:/Project2/111", "mj_qa_section")
|
||||
#elastic.backupIndexToZipfile("G:/Project2/111", "mj_qa_section_ai")
|
||||
#elastic.restorFileToElastic("G:/Project2/111", "mj_qa_section_ai", 'majles', True, "mj_qa_section")
|
||||
|
||||
|
||||
body= {
|
||||
"query": {
|
||||
"bool": {
|
||||
"must": [
|
||||
{
|
||||
"bool": {
|
||||
"should": [
|
||||
{
|
||||
"match_phrase": {
|
||||
"title.ph": {
|
||||
"query": "نسخ ضمنی",
|
||||
"boost": 10
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"match_phrase": {
|
||||
"content.ph": {
|
||||
"query": "نسخ ضمنی",
|
||||
"boost": 10
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"bool": {
|
||||
"filter": {
|
||||
"bool": {
|
||||
"must": [
|
||||
{
|
||||
"term": {
|
||||
"ts_ref.keyword": "اداره کل حقوقی قوه قضاییه"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# elastic.backupIndexToZipfile("G:/Project2/111", "mj_qa_opinion", "mj_qa_opinion_naskh", body, False, ["content"])
|
||||
|
||||
#-------------------------------------------------------
|
||||
#### فایده ای نداشت ....!!!
|
||||
## مسیر درختی مفید تولید نشد و عنوان قانون هم که فیلد مجزا داریم !
|
||||
@@ -118,7 +169,7 @@ elastic.backupIndexToZipfile("G:/Project2/111", "mj_qa_section")
|
||||
## پشتیبان گیری
|
||||
|
||||
# path_back = os.getcwd() + '/data_back'
|
||||
#path_back = 'G:/Project2/111'
|
||||
path_back = 'G:/Project2/111'
|
||||
# if not os.path.exists(path_back) :
|
||||
# os.makedirs(path_back)
|
||||
# print('---> path_back = ' + path_back)
|
||||
@@ -134,6 +185,7 @@ elastic.backupIndexToZipfile("G:/Project2/111", "mj_qa_section")
|
||||
# path_back = 'G:/Project2/_back/back_data/data_majles/elastic/v1.0/full'
|
||||
# elastic.restorFileToElastic(path_back, 'mj_qa_section', 'majles')
|
||||
|
||||
elastic.restorFileToElastic(path_back, 'gn_log_action')
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user