mirror of
https://github.com/searxng/searxng.git
synced 2025-07-12 15:59:21 +02:00
Merge pull request #170 from pointhi/little_fixes
Little fixes, add searx-autocompletion, more informations about torrents
This commit is contained in:
commit
8ef709ea1f
9 changed files with 137 additions and 13 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,13 @@ def autocompleter():
|
|||
if not completer:
|
||||
return '', 400
|
||||
|
||||
# run autocompletion
|
||||
raw_results = completer(query.getSearchQuery())
|
||||
# parse searx specific autocompleter results like !bang
|
||||
raw_results = searx_bang(query)
|
||||
|
||||
# normal autocompletion results only appear if max 3. searx results returned
|
||||
if len(raw_results) <= 3:
|
||||
# run autocompletion
|
||||
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