mirror of
https://github.com/searxng/searxng.git
synced 2025-07-12 15:59:21 +02:00
[enh] add autocompletion for searx-specific strings
This commit is contained in:
parent
29a526ff0e
commit
4e2dae30f0
3 changed files with 85 additions and 3 deletions
|
@ -46,7 +46,7 @@ from searx.languages import language_codes
|
|||
from searx.https_rewrite import https_url_rewrite
|
||||
from searx.search import Search
|
||||
from searx.query import Query
|
||||
from searx.autocomplete import backends as autocomplete_backends
|
||||
from searx.autocomplete import searx_bang, backends as autocomplete_backends
|
||||
from searx import logger
|
||||
|
||||
|
||||
|
@ -352,8 +352,11 @@ def autocompleter():
|
|||
if not completer:
|
||||
return
|
||||
|
||||
# parse searx specific autocompleter results like !bang
|
||||
raw_results = searx_bang(query)
|
||||
|
||||
# run autocompletion
|
||||
raw_results = completer(query.getSearchQuery())
|
||||
raw_results.extend(completer(query.getSearchQuery()))
|
||||
|
||||
# parse results (write :language and !engine back to result string)
|
||||
results = []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue