mirror of
https://github.com/searxng/searxng.git
synced 2026-07-22 16:01:24 +00:00
[fix] autocomplete suggestrelevance scores for chromium
This commit is contained in:
@@ -845,7 +845,10 @@ def autocompleter():
|
|||||||
mimetype = 'application/json'
|
mimetype = 'application/json'
|
||||||
else:
|
else:
|
||||||
# the suggestion request comes from browser's URL bar
|
# the suggestion request comes from browser's URL bar
|
||||||
suggestions = json.dumps([sug_prefix, results])
|
relevances = {
|
||||||
|
'google:suggestrelevance': [600 - i for i in range(len(results))]
|
||||||
|
} # chromium only shows 3 suggestions unless we attach relevances
|
||||||
|
suggestions = json.dumps([sug_prefix, results, [], [], relevances])
|
||||||
mimetype = 'application/x-suggestions+json'
|
mimetype = 'application/x-suggestions+json'
|
||||||
|
|
||||||
suggestions = escape(suggestions, False)
|
suggestions = escape(suggestions, False)
|
||||||
|
|||||||
Reference in New Issue
Block a user