Commit 352a4ba9 authored by 段英荣's avatar 段英荣

modify bug

parent c3d4a0be
......@@ -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=100):
def get_suggest_tips(query,lat,lng,offset=0,size=50):
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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment