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
[fix] restrict wikipedia queries to the titles to avoid irrelevant results
Adam Tauberb5061b5f0fd2
diff --git a/searx/engines/mediawiki.py b/searx/engines/mediawiki.pyindex ff3fad2d7..26d3720d9 100644--- a/searx/engines/mediawiki.py+++ b/searx/engines/mediawiki.py@@ -27,10 +27,10 @@ base_url = 'https://{language}.wikipedia.org/'search_postfix = 'w/api.php?action=query'\'&list=search'\'&{query}'\- '&srprop=timestamp'\'&format=json'\'&sroffset={offset}'\- '&srlimit={limit}'+ '&srlimit={limit}'\+ '&srwhat=nearmatch' # search for a near match in the title# do search-request@@ -74,6 +74,8 @@ def response(resp):# parse resultsfor result in search_results['query']['search']:+ if result.get('snippet', '').startswith('#REDIRECT'):+ continueurl = base_url.format(language=resp.search_params['language']) +\'wiki/' + quote(result['title'].replace(' ', '_').encode('utf-8'))