SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
update comment
Dalfe39d9fe5423a
diff --git a/searx/search.py b/searx/search.pyindex 10916cc50..48f8012f1 100644--- a/searx/search.py+++ b/searx/search.py@@ -106,8 +106,13 @@ def score_results(results):res['host'] = res['host'].replace('www.', '', 1)res['engines'] = [res['engine']]+weight = 1.0+ # strip multiple spaces and cariage returns from content+ if 'content' in res:+ res['content'] = re.sub(' +', ' ', res['content'].strip().replace('\n', ''))+# get weight of this engine if possibleif hasattr(engines[res['engine']], 'weight'):weight = float(engines[res['engine']].weight)@@ -115,12 +120,8 @@ def score_results(results):# calculate score for that enginescore = int((flat_len - i) / engines_len) * weight + 1- duplicated = False-# check for duplicates- if 'content' in res:- res['content'] = re.sub(' +', ' ', res['content'].strip().replace('\n', ''))-+ duplicated = Falsefor new_res in results:# remove / from the end of the url if requiredp1 = res['parsed_url'].path[:-1] if res['parsed_url'].path.endswith('/') else res['parsed_url'].path # noqa