Change ES settings, big refactor, removed recaptcha

This commit is contained in:
simon987
2019-01-13 12:48:39 -05:00
parent d905c3efd5
commit 7f857d641f
18 changed files with 978 additions and 966 deletions

25
restore.py Normal file
View File

@@ -0,0 +1,25 @@
from search.search import ElasticSearchEngine
import ujson
es = ElasticSearchEngine("od-database")
es.reset()
with open("dump.json", "r") as f:
buffer = list()
index_every = 10000
for line in f:
try:
doc = ujson.loads(line)["_source"]
buffer.append(doc)
if len(buffer) >= index_every:
es._index(buffer)
buffer.clear()
except Exception as e:
print("ERROR: " + str(e))
es._index(buffer)