Sfoglia il codice sorgente

Merge dbf79017119e0704c3ed10316da3967d44d90854 into cd819ae74bfc204c86f1b3d1588859ec8f7d8240

ston3o 6 anni fa
parent
commit
ac54e9eff4
No account linked to committer's email
1 ha cambiato i file con 8 aggiunte e 0 eliminazioni
  1. 8
    0
      searx/query.py

+ 8
- 0
searx/query.py Vedi File

@@ -104,6 +104,14 @@ class RawTextQuery(object):
104 104
                         self.languages.append(lang)
105 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 115
             # this force a engine or category
108 116
             if query_part[0] == '!' or query_part[0] == '?':
109 117
                 prefix = query_part[1:].replace('-', ' ').replace('_', ' ')