summaryrefslogtreecommitdiff
path: root/searx/search.py
diff options
context:
space:
mode:
authorCqoicebordel <Cqoicebordel@users.noreply.github.com>2015-06-03 17:16:12 +0200
committerCqoicebordel <Cqoicebordel@users.noreply.github.com>2015-06-03 17:16:12 +0200
commit00668dd0a1289bd1e2d3d50fd26fe0623db390ab (patch)
treeedbb0c30a99f3f0494a9b92f1837179c32e3be49 /searx/search.py
parentaac8d3a7bfdd77a5369e52a4ece99b20669a4625 (diff)
downloadsearxng-00668dd0a1289bd1e2d3d50fd26fe0623db390ab.tar.gz
searxng-00668dd0a1289bd1e2d3d50fd26fe0623db390ab.zip
New feature : language per search engine !
Diffstat (limited to 'searx/search.py')
-rw-r--r--searx/search.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/searx/search.py b/searx/search.py
index e7ac7bb66..bb440352b 100644
--- a/searx/search.py
+++ b/searx/search.py
@@ -237,7 +237,7 @@ def score_results(results):
for k in categoryPositions:
v = categoryPositions[k]['index']
if v >= index:
- categoryPositions[k]['index'] = v+1
+ categoryPositions[k]['index'] = v + 1
# update this category
current['count'] -= 1
@@ -306,7 +306,7 @@ def merge_infoboxes(infoboxes):
if add_infobox:
results.append(infobox)
- infoboxes_id[infobox_id] = len(results)-1
+ infoboxes_id[infobox_id] = len(results) - 1
return results
@@ -472,7 +472,12 @@ class Search(object):
request_params['category'] = selected_engine['category']
request_params['started'] = time()
request_params['pageno'] = self.pageno
- request_params['language'] = self.lang
+
+ if hasattr(engine, 'language'):
+ request_params['language'] = engine.language
+ else:
+ request_params['language'] = self.lang
+
try:
# 0 = None, 1 = Moderate, 2 = Strict
request_params['safesearch'] = int(request.cookies.get('safesearch', 1))