summaryrefslogtreecommitdiff
path: root/searx/results.py
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2016-11-19 20:53:51 +0100
committerAdam Tauber <asciimoo@gmail.com>2016-11-19 20:53:51 +0100
commit971ed0abd159625bd01d0b3ca52c90b394711d77 (patch)
tree952a32dea19318981f959f073a68e731c6c017ea /searx/results.py
parent55dc538398090e437c5e495dddad983a7870d09b (diff)
downloadsearxng-971ed0abd159625bd01d0b3ca52c90b394711d77.tar.gz
searxng-971ed0abd159625bd01d0b3ca52c90b394711d77.zip
[enh] add quick answer functionality with an example answerer
Diffstat (limited to 'searx/results.py')
-rw-r--r--searx/results.py9
1 files changed, 5 insertions, 4 deletions
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):