mirror of
https://github.com/simon987/od-database.git
synced 2025-04-19 18:36:44 +00:00
Should fix timeout error when indexing
This commit is contained in:
parent
81fde6cc30
commit
9aed18c2d2
@ -92,7 +92,7 @@ class ElasticSearchEngine(SearchEngine):
|
|||||||
|
|
||||||
def import_json(self, in_lines, website_id: int):
|
def import_json(self, in_lines, website_id: int):
|
||||||
|
|
||||||
import_every = 25000
|
import_every = 5000
|
||||||
|
|
||||||
docs = []
|
docs = []
|
||||||
|
|
||||||
@ -112,7 +112,7 @@ class ElasticSearchEngine(SearchEngine):
|
|||||||
def _index(self, docs):
|
def _index(self, docs):
|
||||||
print("Indexing " + str(len(docs)) + " docs")
|
print("Indexing " + str(len(docs)) + " docs")
|
||||||
bulk_string = ElasticSearchEngine.create_bulk_index_string(docs)
|
bulk_string = ElasticSearchEngine.create_bulk_index_string(docs)
|
||||||
result = self.es.bulk(body=bulk_string, index=self.index_name, doc_type="file")
|
result = self.es.bulk(body=bulk_string, index=self.index_name, doc_type="file", request_timeout=30)
|
||||||
|
|
||||||
if result["errors"]:
|
if result["errors"]:
|
||||||
print(result)
|
print(result)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user