Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
search_tips
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
rank
search_tips
Commits
352a4ba9
Commit
352a4ba9
authored
Jan 29, 2019
by
段英荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify bug
parent
c3d4a0be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
auto_tips.py
search/utils/auto_tips.py
+5
-3
No files found.
search/utils/auto_tips.py
View file @
352a4ba9
...
...
@@ -12,15 +12,17 @@ from libs.tools import g_hospital_pos_dict
from
libs.tools
import
point_distance
def
get_suggest_tips
(
query
,
lat
,
lng
,
offset
=
0
,
size
=
10
0
):
def
get_suggest_tips
(
query
,
lat
,
lng
,
offset
=
0
,
size
=
5
0
):
try
:
# ios输入法在某些情况下会携带\\u2006
query
=
query
.
replace
(
"
\\
u2006"
,
''
)
q
=
{
"suggest"
:{
"tips-suggest"
:
{
"prefix"
:
query
,
"completion"
:
{
"field"
:
"suggest"
,
"size"
:
size
"size"
:
size
}
}
},
...
...
@@ -47,7 +49,7 @@ def get_suggest_tips(query,lat,lng,offset=0,size=100):
else
:
hit_item
[
"_source"
][
"describe"
]
=
"约"
+
str
(
distance
)
+
"米"
else
:
hit_item
[
"_source"
][
"describe"
]
=
"约"
+
str
(
1.0
*
distance
/
1000
)
+
"km"
hit_item
[
"_source"
][
"describe"
]
=
"约"
+
str
(
round
(
1.0
*
distance
/
1000
,
1
)
)
+
"km"
else
:
hit_item
[
"_source"
][
"describe"
]
=
">1000km"
else
:
...
...
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