From 2f7752b410c449aac463c248c0b7e41f69b6b07b Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Tue, 28 Jun 2016 00:06:50 +0200 Subject: [enh] display number of results --- searx/results.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'searx/results.py') diff --git a/searx/results.py b/searx/results.py index c3040b305..dcd966ef7 100644 --- a/searx/results.py +++ b/searx/results.py @@ -99,6 +99,7 @@ class ResultContainer(object): self._infobox_ids = {} self.suggestions = set() self.answers = set() + self.number_of_results = 0 def extend(self, engine_name, results): for result in list(results): @@ -111,6 +112,9 @@ class ResultContainer(object): elif 'infobox' in result: self._merge_infobox(result) results.remove(result) + elif 'number_of_results' in result: + self.number_of_results = max(self.number_of_results, result['number_of_results']) + results.remove(result) with RLock(): engines[engine_name].stats['search_count'] += 1 -- cgit v1.2.3-54-g00ecf