From 9aed18c2d25e6ef9f49906919dc022cc948a266c Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 14 Jun 2018 20:07:50 -0400 Subject: [PATCH] Should fix timeout error when indexing --- search/search.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/search/search.py b/search/search.py index 1a19e18..c7dec54 100644 --- a/search/search.py +++ b/search/search.py @@ -92,7 +92,7 @@ class ElasticSearchEngine(SearchEngine): def import_json(self, in_lines, website_id: int): - import_every = 25000 + import_every = 5000 docs = [] @@ -112,7 +112,7 @@ class ElasticSearchEngine(SearchEngine): def _index(self, docs): print("Indexing " + str(len(docs)) + " 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"]: print(result)