From 413e143707f9b573d8740cae92152e54df8fdfcd Mon Sep 17 00:00:00 2001 From: David A Roberts Date: Sun, 14 Aug 2016 21:40:28 +1000 Subject: [PATCH 1/3] [fix] don't merge results with distinct fragments --- searx/results.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/searx/results.py b/searx/results.py index 9a4ec0b2..32832f19 100644 --- a/searx/results.py +++ b/searx/results.py @@ -28,7 +28,7 @@ def compare_urls(url_a, url_b): else: host_b = url_b.netloc - if host_a != host_b or url_a.query != url_b.query: + if host_a != host_b or url_a.query != url_b.query or url_a.fragment != url_b.fragment: return False # remove / from the end of the url if required From 1e9dab08e6102383840777e61732fa8e2df78d7c Mon Sep 17 00:00:00 2001 From: David A Roberts Date: Sun, 14 Aug 2016 21:46:54 +1000 Subject: [PATCH 2/3] [fix] behaviour for page_size>1 and first_page_num>0 eg. pageno=1,21,41,... instead of 20,40,60,... --- searx/engines/json_engine.py | 2 +- searx/engines/xpath.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/searx/engines/json_engine.py b/searx/engines/json_engine.py index a824c38e..4604c3ca 100644 --- a/searx/engines/json_engine.py +++ b/searx/engines/json_engine.py @@ -81,7 +81,7 @@ def request(query, params): fp = {'query': query} if paging and search_url.find('{pageno}') >= 0: - fp['pageno'] = (params['pageno'] + first_page_num - 1) * page_size + fp['pageno'] = (params['pageno'] - 1) * page_size + first_page_num params['url'] = search_url.format(**fp) params['query'] = query diff --git a/searx/engines/xpath.py b/searx/engines/xpath.py index e701c02b..e5c0c5be 100644 --- a/searx/engines/xpath.py +++ b/searx/engines/xpath.py @@ -87,7 +87,7 @@ def request(query, params): fp = {'query': query} if paging and search_url.find('{pageno}') >= 0: - fp['pageno'] = (params['pageno'] + first_page_num - 1) * page_size + fp['pageno'] = (params['pageno'] - 1) * page_size + first_page_num params['url'] = search_url.format(**fp) params['query'] = query From 45120bc71190b03d549547a696e8aa019277200a Mon Sep 17 00:00:00 2001 From: David A Roberts Date: Sun, 14 Aug 2016 21:48:57 +1000 Subject: [PATCH 3/3] Add Hoogle search engine --- searx/settings.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/searx/settings.yml b/searx/settings.yml index f0d33e50..db5a4f7c 100644 --- a/searx/settings.yml +++ b/searx/settings.yml @@ -281,6 +281,18 @@ engines: disabled : True shortcut : habr + - name : hoogle + engine : json_engine + paging : True + search_url : https://www.haskell.org/hoogle/?mode=json&hoogle={query}&start={pageno} + results_query : results + url_query : location + title_query : self + content_query : docs + page_size : 20 + categories : it + shortcut : ho + - name : ina engine : ina shortcut : in