From 971ed0abd159625bd01d0b3ca52c90b394711d77 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Sat, 19 Nov 2016 20:53:51 +0100 Subject: [enh] add quick answer functionality with an example answerer --- searx/results.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'searx/results.py') diff --git a/searx/results.py b/searx/results.py index 634f71acd..73a96c081 100644 --- a/searx/results.py +++ b/searx/results.py @@ -146,16 +146,17 @@ class ResultContainer(object): self._number_of_results.append(result['number_of_results']) results.remove(result) - with RLock(): - engines[engine_name].stats['search_count'] += 1 - engines[engine_name].stats['result_count'] += len(results) + if engine_name in engines: + with RLock(): + engines[engine_name].stats['search_count'] += 1 + engines[engine_name].stats['result_count'] += len(results) if not results: return self.results[engine_name].extend(results) - if not self.paging and engines[engine_name].paging: + if not self.paging and engine_name in engines and engines[engine_name].paging: self.paging = True for i, result in enumerate(results): -- cgit v1.2.3-54-g00ecf