Skip to content

Commit d8a199a

Browse files
committed
handle engines in the deletion scripts
1 parent fcb40fb commit d8a199a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

config_generation/delete_server_content.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@
22

33
from db_to_xml_file_based import XmlEditor
44

5-
from config import batch_delete_name, collection_list, indexes_to_delete_from, source
5+
from config import batch_delete_name, collection_list, indexes_to_delete_from, source, engines
66

77
COMMAND_FILES_PATH = "../sinequa_configs/commands/"
88
DELETE_COMMAND_TEMPLATE_PATH = "xmls/delete_template.xml"
99

1010
command_file = XmlEditor(DELETE_COMMAND_TEMPLATE_PATH)
1111

12+
command_file.update_or_add_element_value(element_name="Engines", element_value=",".join([engine for engine in engines]))
1213
for collection in collection_list:
1314
for index in indexes_to_delete_from:
1415
sql = f"delete from {index} where collection='/{source}/{collection}/'"
1516
command_file.update_or_add_element_value(element_name="SQL", element_value=sql, add_duplicate=True)
17+
1618
file_name = f"{COMMAND_FILES_PATH}{batch_delete_name}.xml"
1719
command_file._update_config_xml(file_name)

config_generation/xmls/delete_template.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,5 @@
1818
<DisablePerfData>true</DisablePerfData>
1919
<OtherOptions></OtherOptions>
2020
</Java>
21-
<Engines>@Engine_1,@Engine_2,@Engine_3</Engines>
2221
<IsSqlPattern>false</IsSqlPattern>
23-
</Sinequa>
22+
</Sinequa>

0 commit comments

Comments
 (0)