浏览代码

- recoll.py: add number_of_results

frankdelange 6 年前
父节点
当前提交
b5bcf193f4
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 5
    3
      searx/engines/recoll.py

+ 5
- 3
searx/engines/recoll.py 查看文件

@@ -54,12 +54,12 @@ def request(query, params):
54 54
 def response(resp):
55 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 60
         return []
61 61
 
62
-    for result in raw_search_results.get('results', []):
62
+    for result in response_json.get('results', []):
63 63
         title = result['label']
64 64
         url = result['url'].replace('file:///export', dl_prefix)
65 65
         content = u'{}'.format(result['snippet'])
@@ -79,4 +79,6 @@ def response(resp):
79 79
 
80 80
         results.append(item)
81 81
 
82
+    results.append({'number_of_results': response_json['nres']})
83
+
82 84
     return results