Commit 295ba4fe authored by 段英荣's avatar 段英荣

modify

parent 3431759e
......@@ -22,7 +22,13 @@ def get_suggest_tips(query,lat,lng,offset=0,size=50):
"prefix": query,
"completion": {
"field": "suggest",
"size": size
"size": size,
"contexts":{
"is_online":[True]
},
"fuzzy":{
"fuzziness": 0
}
}
}
},
......
......@@ -3,7 +3,13 @@
"properties": {
"id":{"type":"text"},
"suggest":{
"type":"completion"
"type":"completion",
"contexts":[
{
"name":"is_online",
"type": "category"
}
]
},
"suggest_type":{"type":"long"},//0-汉字,1-汉字全拼,2-拼音,3-拼音全拼,4-拼音简写,5-拼音简写全拼
"tips_name_type":{"type":"long"},//tips数据所属类型,0-tag,1-hospital,2-doctor,3-wiki
......
......@@ -145,7 +145,10 @@ class TypeInfo(object):
suggest_dict["id"] = str(suggest_dict["id"]) + "_" + str(suggest_item["cur_index"])
suggest_dict["suggest"] = {
"input": suggest_item["input"],
"weight": int(suggest_dict["offline_score"])
"weight": int(suggest_dict["offline_score"]),
"contexts":{
"is_online": suggest_dict["is_online"]
}
}
data_list.append(suggest_dict)
for resemble_item in resemble_list:
......
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