diff options
author | Noémi Ványi <sitbackandwait@gmail.com> | 2018-03-22 11:02:24 +0100 |
---|---|---|
committer | Noémi Ványi <sitbackandwait@gmail.com> | 2018-03-22 11:02:24 +0100 |
commit | 8cc529e9a3976e48676676600379ce43f690dd8c (patch) | |
tree | b21dd9ad903afe756ce43ce996e1806e26cbd2c1 /searx/query.py | |
parent | d04e471ce53c5efd224a4ed0e7b5d88fb0d3a093 (diff) | |
download | searxng-8cc529e9a3976e48676676600379ce43f690dd8c.tar.gz searxng-8cc529e9a3976e48676676600379ce43f690dd8c.zip |
forward category to engine without highlighting on the ui
Diffstat (limited to 'searx/query.py')
-rw-r--r-- | searx/query.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/searx/query.py b/searx/query.py index 6e5f2e883..f7543e3e1 100644 --- a/searx/query.py +++ b/searx/query.py @@ -107,14 +107,21 @@ class RawTextQuery(object): # check if prefix is equal with engine shortcut if prefix in engine_shortcuts: parse_next = True - self.engines.append({'category': 'none', - 'name': engine_shortcuts[prefix]}) + engine_name = engine_shortcuts[prefix] + if engine_name in engines: + for engine_category in engines[engine_name].categories: + self.engines.append({'category': engine_category, + 'name': engine_name, + 'from_bang': True}) # check if prefix is equal with engine name elif prefix in engines: parse_next = True - self.engines.append({'category': 'none', - 'name': prefix}) + if prefix in engines: + for engine_category in engines[engine_name].categories: + self.engines.append({'category': engine_category, + 'name': engine_name, + 'from_bang': True}) # check if prefix is equal with categorie name elif prefix in categories: |