Esempio n. 1
0
def index_bulk_DB_HYPERPARTISAN_TOOL_ZETTAIR():
    initial = time.time()

    testTool = IndexToolManager(indexName=str(hyperpartisan_db_name + '_bulk'))

    start = time.time()
    bulk = testTool.get_documents_DB_HYPERPARTISAN(
        hyperpartisan_articles_xml, hyperpartisan_ground_truth_xml)
    end = time.time()
    mylogger.info(f'get_documents_DB_HYPERPARTISAN {end - start}')
    mylogger.info(f'TOTAL documents DB_HYPERPARTISAN  {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_HYPERPARTISAN_TOOL_ZETTAIR: {final - initial}')
Esempio n. 2
0
def index_DB_HYPERPARTISAN_TOOL_ELASTIC():
    initial = time.time()

    testTool = IndexToolManager(indexName=hyperpartisan_db_name)

    start = time.time()
    bulk = testTool.get_documents_DB_HYPERPARTISAN(
        hyperpartisan_articles_xml, hyperpartisan_ground_truth_xml)
    end = time.time()
    mylogger.info(f'get_documents_DB_HYPERPARTISAN {end - start}')
    mylogger.info(f'TOTAL documents DB_HYPERPARTISAN  {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_HYPERPARTISAN_TOOL_ELASTIC: {final - initial}')
Esempio n. 3
0
def index_bulk_DB_HYPERPARTISAN_TOOL_ELASTIC():
    initial = time.time()

    testTool = IndexToolManager(indexName=str(hyperpartisan_db_name + '_bulk'))

    start = time.time()
    bulk = testTool.get_documents_DB_HYPERPARTISAN(
        hyperpartisan_articles_xml, hyperpartisan_ground_truth_xml)
    end = time.time()
    mylogger.info(f'get_documents_DB_HYPERPARTISAN {end - start}')
    mylogger.info(f'TOTAL documents DB_HYPERPARTISAN  {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_HYPERPARTISAN_TOOL_ELASTIC: {final - initial}')
Esempio n. 4
0
def index_bulk_DB_HYPERPARTISAN_TOOL_ARANGO():
    initial = time.time()

    testTool = IndexToolManager(indexName=str(hyperpartisan_db_name + '_bulk'))

    start = time.time()
    bulk = testTool.get_documents_DB_HYPERPARTISAN(
        hyperpartisan_articles_xml, hyperpartisan_ground_truth_xml)
    end = time.time()
    mylogger.info(f'get_documents_DB_HYPERPARTISAN {end - start}')
    mylogger.info(f'TOTAL documents DB_HYPERPARTISAN  {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_HYPERPARTISAN_TOOL_ARANGO: {final - initial}')