def index_bulk_DB_AUTHORPROF_TOOL_ZETTAIR(): initial = time.time() testTool = IndexToolManager(indexName=str(authorprof_db_name + '_bulk')) start = time.time() bulk = testTool.get_documents_DB_AUTHORPROF(authorprof_xml_folder, authorprof_truth_txt) end = time.time() mylogger.info(f'get_documents_DB_AUTHORPROF {end - start}') mylogger.info(f'TOTAL documents DB_AUTHORPROF {len(bulk)}') start = time.time() testTool.saveToTrecFileZettair(bulk) end = time.time() mylogger.info(f'saveToTrecFileZettair {end - start}') start = time.time() testTool.zettair_index() end = time.time() mylogger.info(f'zettair_index {end - start}') final = time.time() mylogger.info(f'index_bulk_DB_AUTHORPROF_TOOL_ZETTAIR: {final - initial}')
def index_DB_AUTHORPROF_TOOL_ELASTIC(): initial = time.time() testTool = IndexToolManager(indexName=authorprof_db_name) start = time.time() bulk = testTool.get_documents_DB_AUTHORPROF(authorprof_xml_folder, authorprof_truth_txt) end = time.time() mylogger.info(f'get_documents_DB_AUTHORPROF {end - start}') mylogger.info(f'TOTAL documents DB_AUTHORPROF {len(bulk)}') start = time.time() for doc in bulk: testTool.insertElastic(doc.pop('id'), doc) end = time.time() mylogger.info(f'for-loop insertElastic {end - start}') start = time.time() testTool.refreshElastic() end = time.time() mylogger.info(f'refreshElastic {end - start}') final = time.time() mylogger.info(f'index_DB_AUTHORPROF_TOOL_ELASTIC: {final - initial}')
def index_bulk_DB_AUTHORPROF_TOOL_ELASTIC(): initial = time.time() testTool = IndexToolManager(indexName=str(authorprof_db_name + '_bulk')) start = time.time() bulk = testTool.get_documents_DB_AUTHORPROF(authorprof_xml_folder, authorprof_truth_txt) end = time.time() mylogger.info(f'get_documents_DB_AUTHORPROF {end - start}') mylogger.info(f'TOTAL documents DB_AUTHORPROF {len(bulk)}') start = time.time() bulkBody = testTool.bulkInsertGeneratorElastic(bulk) end = time.time() mylogger.info(f'bulkInsertGeneratorElastic {end - start}') start = time.time() testTool.bulkElastic(bulkBody) end = time.time() mylogger.info(f'bulkElastic {end - start}') start = time.time() testTool.refreshElastic() end = time.time() mylogger.info(f'refreshElastic {end - start}') final = time.time() mylogger.info(f'index_bulk_DB_AUTHORPROF_TOOL_ELASTIC: {final - initial}')
def index_bulk_DB_AUTHORPROF_TOOL_ARANGO(): initial = time.time() testTool = IndexToolManager(indexName=str(authorprof_db_name + '_bulk')) start = time.time() bulk = testTool.get_documents_DB_AUTHORPROF(authorprof_xml_folder, authorprof_truth_txt) end = time.time() mylogger.info(f'get_documents_DB_AUTHORPROF {end - start}') mylogger.info(f'TOTAL documents DB_AUTHORPROF {len(bulk)}') start = time.time() documentList = testTool.bulkListGeneratorArango(bulk) end = time.time() mylogger.info(f'bulkListGeneratorArango {end - start}') start = time.time() testTool.bulkImportArango(documentList) end = time.time() mylogger.info(f'bulkImportArango {end - start}') final = time.time() mylogger.info(f'index_bulk_DB_AUTHORPROF_TOOL_ARANGO: {final - initial}')