Browse Source

- recoll.py: add number_of_results

frankdelange 6 years ago
parent
commit
b5bcf193f4
1 changed files with 5 additions and 3 deletions
  1. 5
    3
      searx/engines/recoll.py

+ 5
- 3
searx/engines/recoll.py View File

54
 def response(resp):
54
 def response(resp):
55
     results = []
55
     results = []
56
 
56
 
57
-    raw_search_results = loads(resp.text)
57
+    response_json = loads(resp.text)
58
 
58
 
59
-    if not raw_search_results:
59
+    if not response_json:
60
         return []
60
         return []
61
 
61
 
62
-    for result in raw_search_results.get('results', []):
62
+    for result in response_json.get('results', []):
63
         title = result['label']
63
         title = result['label']
64
         url = result['url'].replace('file:///export', dl_prefix)
64
         url = result['url'].replace('file:///export', dl_prefix)
65
         content = u'{}'.format(result['snippet'])
65
         content = u'{}'.format(result['snippet'])
79
 
79
 
80
         results.append(item)
80
         results.append(item)
81
 
81
 
82
+    results.append({'number_of_results': response_json['nres']})
83
+
82
     return results
84
     return results