on master help sign in
Merge branch 'master' of https://github.com/asciimoo/searx into filtron
commit3f3351639a04d27f7ba01ffef505b1cc53baa17c authorMarkus Heiser <markus.heiser@darmarit.de> dateSun 23 Feb 2020, 21:06 (7 years ago) parentf17b28709f4e2c
3 files changed+18−2
Dockerfile+8−1 searx/autocomplete.py+9 searx/settings.yml+1−1
Dockerfile+8−1
@@ -76,4 +76,11 @@ LABEL maintainer="searx <https://github.com/asciimoo/searx>" \
7676 org.label-schema.vcs-ref=${LABEL_VCS_REF} \
7777 org.label-schema.vcs-url=${LABEL_VCS_URL} \
7878 org.label-schema.build-date="${LABEL_DATE}" \
79− org.label-schema.usage="https://github.com/searx/searx-docker"
79+ org.label-schema.usage="https://github.com/searx/searx-docker" \
80+ org.opencontainers.image.title="searx" \
81+ org.opencontainers.image.version="${SEARX_GIT_VERSION}" \
82+ org.opencontainers.image.url="${LABEL_VCS_URL}" \
83+ org.opencontainers.image.revision=${LABEL_VCS_REF} \
84+ org.opencontainers.image.source=${LABEL_VCS_URL} \
85+ org.opencontainers.image.created="${LABEL_DATE}" \
86+ org.opencontainers.image.documentation="https://github.com/searx/searx-docker"
searx/autocomplete.py+9
@@ -165,6 +165,14 @@ def startpage(query, lang):
165165 return []
166166
167167
168+def swisscows(query, lang):
169+ # swisscows autocompleter
170+ url = 'https://swisscows.ch/api/suggest?{query}&itemsCount=5'
171+
172+ resp = loads(get(url.format(query=urlencode({'query': query}))).text)
173+ return resp
174+
175+
168176def qwant(query, lang):
169177 # qwant autocompleter (additional parameter : lang=en_en&count=xxx )
170178 url = 'https://api.qwant.com/api/suggest?{query}'
@@ -196,6 +204,7 @@ backends = {'dbpedia': dbpedia,
196204 'duckduckgo': duckduckgo,
197205 'google': google,
198206 'startpage': startpage,
207+ 'swisscows': swisscows,
199208 'qwant': qwant,
200209 'wikipedia': wikipedia
201210 }
searx/settings.yml+1−1
@@ -4,7 +4,7 @@ general:
44
55search:
66 safe_search : 0 # Filter results. 0: None, 1: Moderate, 2: Strict
7− autocomplete : "" # Existing autocomplete backends: "dbpedia", "duckduckgo", "google", "startpage", "wikipedia" - leave blank to turn it off by default
7+ autocomplete : "" # Existing autocomplete backends: "dbpedia", "duckduckgo", "google", "startpage", "swisscows", "qwant", "wikipedia" - leave blank to turn it off by default
88 default_lang : "" # Default search language - leave blank to detect from browser information or use codes from 'languages.py'
99 ban_time_on_fail : 5 # ban time in seconds after engine errors
1010 max_ban_time_on_fail : 120 # max ban time in seconds after engine errors