2 Commits

Author SHA1 Message Date
Ivan Gabaldon
c63835bd2a [mod] data: update searx.data - update_wikidata_units.py (#6474) 2026-08-04 19:38:59 +02:00
vojkovic
1689cb1b53 [feat] autocomplete: add kagi autocompleter 2026-08-05 00:00:54 +08:00
4 changed files with 37 additions and 7 deletions

View File

@@ -41,6 +41,7 @@
- ``dbpedia``
- ``duckduckgo``
- ``google``
- ``kagi``
- ``mwmbl``
- ``naver``
- ``privacywall``

View File

@@ -157,6 +157,24 @@ def google_complete(query: str, sxng_locale: str) -> list[str]:
return results
def kagi(query: str, sxng_locale: str) -> list[str]:
"""Autocomplete from Kagi."""
args: dict[str, str] = {'q': query}
if '-' in sxng_locale:
args['r'] = sxng_locale.split('-')[1].lower()
resp = get("https://kagisuggest.com/api/autosuggest?" + urlencode(args))
results: list[str] = []
if resp.ok:
data = resp.json()
if len(data) > 1:
results = data[1]
return results
def mwmbl(query: str, _sxng_locale: str) -> list[str]:
"""Autocomplete from Mwmbl_."""
@@ -380,6 +398,7 @@ backends: dict[str, t.Callable[[str, str], list[str]]] = {
'dbpedia': dbpedia,
'duckduckgo': duckduckgo,
'google': google_complete,
'kagi': kagi,
'mwmbl': mwmbl,
'naver': naver,
'privacywall': privacywall,

View File

@@ -3521,7 +3521,7 @@
},
"Q1377741": {
"si_name": "Q25250",
"symbol": "V_P",
"symbol": "V<sub>P</sub>",
"to_si_factor": 1.0429e+27
},
"Q1386162": {
@@ -3694,6 +3694,11 @@
"symbol": "apc",
"to_si_factor": 0.0308568
},
"Q16068": {
"si_name": null,
"symbol": "DM",
"to_si_factor": null
},
"Q160857": {
"si_name": "Q25236",
"symbol": "hp",
@@ -3872,11 +3877,11 @@
"Q180892": {
"si_name": "Q11570",
"symbol": "M☉",
"to_si_factor": 1.9884e+30
"to_si_factor": 1.988416e+30
},
"Q1811": {
"si_name": "Q11573",
"symbol": "AU",
"symbol": "au",
"to_si_factor": 149597870700.0
},
"Q1815100": {
@@ -4454,6 +4459,11 @@
"symbol": "ng",
"to_si_factor": 1e-12
},
"Q2285395": {
"si_name": null,
"symbol": "dBW",
"to_si_factor": null
},
"Q22934083": {
"si_name": "Q25406",
"symbol": "nC",
@@ -6316,7 +6326,7 @@
},
"Q536785": {
"si_name": "Q844211",
"symbol": "ρ_P",
"symbol": "ρ<sub>P</sub>",
"to_si_factor": 5.155e+96
},
"Q53679433": {
@@ -6971,7 +6981,7 @@
},
"Q685662": {
"si_name": "Q44395",
"symbol": "p_P",
"symbol": "p<sub>P</sub>",
"to_si_factor": 4.633e+113
},
"Q686163": {

View File

@@ -41,8 +41,8 @@ search:
# Filter results. 0: None, 1: Moderate, 2: Strict
safe_search: 0
# Existing autocomplete backends: "360search", "baidu", "bing", "brave", "dbpedia", "duckduckgo", "google",
# "yandex", "privacywall", "mwmbl", "naver", "seznam", "sogou", "startpage", "swisscows", "quark", "qwant",
# "wikipedia" - leave blank to turn it off by default.
# "kagi", "yandex", "privacywall", "mwmbl", "naver", "seznam", "sogou", "startpage", "swisscows", "quark",
# "qwant", "wikipedia" - leave blank to turn it off by default.
autocomplete: ""
# minimun characters to type before autocompleter starts
autocomplete_min: 4