Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
searx-engine
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
searx-engine
Commits
09f4e2cd
Unverified
Commit
09f4e2cd
authored
Feb 23, 2020
by
Markus Heiser
Committed by
GitHub
Feb 23, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1846 from piplongrun/autocomplete_swisscows
Add Swisscows autocomplete option
parents
57efb45c
f272781a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
autocomplete.py
searx/autocomplete.py
+9
-0
settings.yml
searx/settings.yml
+1
-1
No files found.
searx/autocomplete.py
View file @
09f4e2cd
...
...
@@ -165,6 +165,14 @@ def startpage(query, lang):
return
[]
def
swisscows
(
query
,
lang
):
# swisscows autocompleter
url
=
'https://swisscows.ch/api/suggest?{query}&itemsCount=5'
resp
=
loads
(
get
(
url
.
format
(
query
=
urlencode
({
'query'
:
query
})))
.
text
)
return
resp
def
qwant
(
query
,
lang
):
# qwant autocompleter (additional parameter : lang=en_en&count=xxx )
url
=
'https://api.qwant.com/api/suggest?{query}'
...
...
@@ -196,6 +204,7 @@ backends = {'dbpedia': dbpedia,
'duckduckgo'
:
duckduckgo
,
'google'
:
google
,
'startpage'
:
startpage
,
'swisscows'
:
swisscows
,
'qwant'
:
qwant
,
'wikipedia'
:
wikipedia
}
searx/settings.yml
View file @
09f4e2cd
...
...
@@ -4,7 +4,7 @@ general:
search
:
safe_search
:
0
# Filter results. 0: None, 1: Moderate, 2: Strict
autocomplete
:
"
"
# Existing autocomplete backends: "dbpedia", "duckduckgo", "google", "startpage", "wikipedia" - leave blank to turn it off by default
autocomplete
:
"
"
# Existing autocomplete backends: "dbpedia", "duckduckgo", "google", "startpage", "
swisscows", "qwant", "
wikipedia" - leave blank to turn it off by default
default_lang
:
"
"
# Default search language - leave blank to detect from browser information or use codes from 'languages.py'
ban_time_on_fail
:
5
# ban time in seconds after engine errors
max_ban_time_on_fail
:
120
# max ban time in seconds after engine errors
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment