-
Notifications
You must be signed in to change notification settings - Fork 0
/
load.py
28 lines (24 loc) · 953 Bytes
/
load.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
__author__ = "Jeremy Nelson"
from rdfframework.configuration import RdfConfigManager
from rdfframework import rdfclass
from rdfframework import search
import os, sys, pdb
def setup_dpla_indexing():
current_path = os.path.abspath(os.path.dirname(__file__))
print("Current path is {}".format(current_path))
sys.path.append("{}/instance".format(current_path))
print("Importing config")
import config
conf_mgr = RdfConfigManager(config.__dict__)
print("Configuration Manager {}".format(conf_mgr))
mappings = search.EsMappings()
mappings.initialize_indices()
print("Finished initialized ES mapping Indices")
dpla_search = search.EsRdfBulkLoader(
rdfclass.bf_Work,
conf_mgr.conns.datastore,
conf_mgr.conns.search,
no_threading=False,
idx_only_base=True)
if __name__ == '__main__':
setup_dpla_indexing()