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
40272b00
Commit
40272b00
authored
Jan 19, 2018
by
Marc Abonce Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix] never pass bangs to autocomplete suggestions
parent
69c8ad86
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
autocomplete.py
searx/autocomplete.py
+4
-0
webapp.py
searx/webapp.py
+5
-2
No files found.
searx/autocomplete.py
View file @
40272b00
...
...
@@ -16,6 +16,7 @@ along with searx. If not, see < http://www.gnu.org/licenses/ >.
'''
import
sys
from
lxml
import
etree
from
json
import
loads
from
searx
import
settings
...
...
@@ -26,6 +27,9 @@ from searx.engines import (
from
searx.poolrequests
import
get
as
http_get
from
searx.url_utils
import
urlencode
if
sys
.
version_info
[
0
]
==
3
:
unicode
=
str
def
get
(
*
args
,
**
kwargs
):
if
'timeout'
not
in
kwargs
:
...
...
searx/webapp.py
View file @
40272b00
...
...
@@ -636,8 +636,11 @@ def autocompleter():
# parse searx specific autocompleter results like !bang
raw_results
=
searx_bang
(
raw_text_query
)
# normal autocompletion results only appear if max 3 inner results returned
if
len
(
raw_results
)
<=
3
and
completer
:
# normal autocompletion results only appear if no inner results returned
# and there is a query part besides the engine and language bangs
if
len
(
raw_results
)
==
0
and
completer
and
(
len
(
raw_text_query
.
query_parts
)
>
1
or
(
len
(
raw_text_query
.
languages
)
==
0
and
not
raw_text_query
.
specific
)):
# get language from cookie
language
=
request
.
preferences
.
get_value
(
'language'
)
if
not
language
or
language
==
'all'
:
...
...
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