diff options
author | Adam Tauber <asciimoo@gmail.com> | 2015-09-11 18:33:06 +0200 |
---|---|---|
committer | Adam Tauber <asciimoo@gmail.com> | 2015-09-11 18:33:06 +0200 |
commit | 37c3ace3096d9568f8dbdc3728659f4c77377b33 (patch) | |
tree | c1d852870f9c384248f2a61baaff49a03b2ed053 /searx/search.py | |
parent | e3df22b1401742ae0ade324ce4403f2b2b45dfe1 (diff) | |
download | searxng-37c3ace3096d9568f8dbdc3728659f4c77377b33.tar.gz searxng-37c3ace3096d9568f8dbdc3728659f4c77377b33.zip |
[fix] add missing scheme to duplicated results too ++ revert gigablasts handling
Diffstat (limited to 'searx/search.py')
-rw-r--r-- | searx/search.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/searx/search.py b/searx/search.py index 899171242..f2b5235b8 100644 --- a/searx/search.py +++ b/searx/search.py @@ -143,6 +143,10 @@ def score_results(results): res['parsed_url'] = urlparse(res['url']) + # if the result has no scheme, use http as default + if not res['parsed_url'].scheme: + res['parsed_url'] = res['parsed_url']._replace(scheme="http") + res['host'] = res['parsed_url'].netloc if res['host'].startswith('www.'): @@ -206,9 +210,6 @@ def score_results(results): # if there is no duplicate found, append result else: res['score'] = score - # if the result has no scheme, use http as default - if res['parsed_url'].scheme == '': - res['parsed_url'] = res['parsed_url']._replace(scheme="http") results.append(res) |