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
07c8ca87
Unverified
Commit
07c8ca87
authored
Dec 23, 2019
by
Markus Heiser
Committed by
GitHub
Dec 23, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into makefile-doc
parents
c8645d6e
3e14bf4d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
wikipedia.py
searx/engines/wikipedia.py
+4
-2
webapp.py
searx/webapp.py
+5
-5
No files found.
searx/engines/wikipedia.py
View file @
07c8ca87
...
...
@@ -21,7 +21,8 @@ search_url = base_url + u'w/api.php?'\
'action=query'
\
'&format=json'
\
'&{query}'
\
'&prop=extracts|pageimages'
\
'&prop=extracts|pageimages|pageprops'
\
'&ppprop=disambiguation'
\
'&exintro'
\
'&explaintext'
\
'&pithumbsize=300'
\
...
...
@@ -87,7 +88,7 @@ def response(resp):
if
int
(
article_id
)
>
0
:
break
if
int
(
article_id
)
<
0
:
if
int
(
article_id
)
<
0
or
'disambiguation'
in
page
.
get
(
'pageprops'
,
{})
:
return
[]
title
=
page
.
get
(
'title'
)
...
...
@@ -99,6 +100,7 @@ def response(resp):
extract
=
page
.
get
(
'extract'
)
summary
=
extract_first_paragraph
(
extract
,
title
,
image
)
summary
=
summary
.
replace
(
'() '
,
''
)
# link to wikipedia article
wikipedia_link
=
base_url
.
format
(
language
=
url_lang
(
resp
.
search_params
[
'language'
]))
\
...
...
searx/webapp.py
View file @
07c8ca87
...
...
@@ -606,11 +606,11 @@ def index():
# HTML output format
# suggestions: use RawTextQuery to get the suggestion URLs with the same bang
suggestion_urls
=
map
(
lambda
suggestion
:
{
'url'
:
raw_text_query
.
changeSearchQuery
(
suggestion
)
.
getFullQuery
(),
'title'
:
suggestion
},
result_container
.
suggestions
)
suggestion_urls
=
list
(
map
(
lambda
suggestion
:
{
'url'
:
raw_text_query
.
changeSearchQuery
(
suggestion
)
.
getFullQuery
(),
'title'
:
suggestion
},
result_container
.
suggestions
)
)
correction_urls
=
list
(
map
(
lambda
correction
:
{
'url'
:
raw_text_query
.
changeSearchQuery
(
correction
)
.
getFullQuery
(),
...
...
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