summaryrefslogtreecommitdiff
path: root/searx/search.py
diff options
context:
space:
mode:
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 f58b6167c..0324d4aaf 100644
--- a/searx/search.py
+++ b/searx/search.py
@@ -373,7 +373,7 @@ class Search(object):
# if engines are calculated from query,
# set categories by using that informations
- if self.engines:
+ if self.engines and query_obj.specific:
self.categories = list(set(engine['category']
for engine in self.engines))
@@ -384,12 +384,17 @@ class Search(object):
for pd_name, pd in self.request_data.items():
if pd_name.startswith('category_'):
category = pd_name[9:]
+
# if category is not found in list, skip
if category not in categories:
continue
- # add category to list
- self.categories.append(category)
+ if pd != 'off':
+ # add category to list
+ self.categories.append(category)
+ elif category in self.categories:
+ # remove category from list if property is set to 'off'
+ self.categories.remove(category)
# if no category is specified for this search,
# using user-defined default-configuration which