Browse Source

Merge dbf79017119e0704c3ed10316da3967d44d90854 into cd819ae74bfc204c86f1b3d1588859ec8f7d8240

ston3o 6 years ago
parent
commit
ac54e9eff4
No account linked to committer's email
1 changed files with 8 additions and 0 deletions
  1. 8
    0
      searx/query.py

+ 8
- 0
searx/query.py View File

104
                         self.languages.append(lang)
104
                         self.languages.append(lang)
105
                         parse_next = True
105
                         parse_next = True
106
 
106
 
107
+            # this force a engine
108
+            suffix = raw_query_parts[-1:][0]
109
+            if suffix[0] == '!':
110
+                suffix = suffix.replace('!', '')
111
+                if suffix in engine_shortcuts:
112
+                    self.engines.append({'category': 'none', 'name': engine_shortcuts[suffix]})
113
+                    self.specific = True
114
+
107
             # this force a engine or category
115
             # this force a engine or category
108
             if query_part[0] == '!' or query_part[0] == '?':
116
             if query_part[0] == '!' or query_part[0] == '?':
109
                 prefix = query_part[1:].replace('-', ' ').replace('_', ' ')
117
                 prefix = query_part[1:].replace('-', ' ').replace('_', ' ')