Refresh index before reddit comment callback

This commit is contained in:
Simon
2018-08-09 16:19:21 -04:00
parent 8ffd9179d2
commit ffeed4192e
2 changed files with 7 additions and 0 deletions

View File

@@ -31,6 +31,9 @@ class SearchEngine:
def get_stats(self, website_id: int, subdir: str = None):
raise NotImplementedError
def refresh(self):
raise NotImplementedError
class ElasticSearchEngine(SearchEngine):
SORT_ORDERS = {
@@ -460,3 +463,6 @@ class ElasticSearchEngine(SearchEngine):
for website in websites:
if website not in non_empty_websites:
yield website
def refresh(self):
self.es.indices.refresh(self.index_name)