Commit 80561432 authored by 段英荣's avatar 段英荣

modify

parent a2332a72
......@@ -33,7 +33,7 @@ def get_suggest_tips(query,lat,lng,offset=0,size=50):
}
},
"_source": {
"include": ["id", "ori_name", "offline_score", "is_online","type_flag","results_num"]
"includes": ["id", "ori_name", "offline_score", "is_online","type_flag","results_num"]
}
}
......
......@@ -21,8 +21,9 @@ def uuid4():
def get_tips_suggest_list(instance_cn_name):
try:
ch_full_weight = 6.0 * 1000
py_full_weight = 3.0 * 1000
#ch_full_weight = 6.0 * 1000
#py_full_weight = 3.0 * 1000
full_weight = 3.0 * 1000
py_acronym_full_weight = 3.0 * 1000
py_acronym_prefix_weight = 2
......@@ -42,7 +43,7 @@ def get_tips_suggest_list(instance_cn_name):
for i in range(len(ch_full_word)):
ch_name_term = ch_full_word[i:].strip()
if ch_name_term and ch_full_word[i]!="(" and ch_full_word[i]!=")":
prefix_weight = ch_prefix_weight if len(ch_name_term) != len(ch_full_word) else ch_full_weight
prefix_weight = ch_prefix_weight if len(ch_name_term) != len(ch_full_word) else full_weight
suggest_type = 0 if len(ch_name_term) != len(ch_full_word) else 1
term_begin_prefix_weight = begin_prefix_weight if i == 0 else 1.0
suggest_item = {
......@@ -64,8 +65,7 @@ def get_tips_suggest_list(instance_cn_name):
for i in range(len(py_full_word)):
py_name_term = py_full_word[i:].strip()
if py_name_term and py_full_word[i]!="(" and py_full_word[i]!=")":
prefix_weight = py_prefix_weight if len(py_name_term) != len(
py_full_word) else py_full_weight
prefix_weight = py_prefix_weight if len(py_name_term) != len(py_full_word) else full_weight
suggest_type = 2 if len(py_name_term) != len(py_full_word) else 3
term_begin_prefix_weight = begin_prefix_weight if i == 0 else 1.0
suggest_item = {
......
......@@ -24,6 +24,8 @@ from trans2es.utils.tag_transfer import TagTransfer
from trans2es.utils.wordresemble import WordResemble
from libs.es import ESPerform
from libs.tools import tzlc,getMd5Digest
from trans2es.commons.words_utils import QueryWordAttr
from gm_types.gaia import SERVICE_ITEM_PRICE_TYPE, DOCTOR_TYPE
from gm_types.gaia import (
......@@ -155,6 +157,7 @@ class TypeInfo(object):
resemble_dict = copy.deepcopy(suggest_dict)
resemble_dict["id"] = suggest_dict["id"] + "_" + getMd5Digest(resemble_item)
resemble_dict["ori_name"] = resemble_item
resemble_dict["results_num"] = QueryWordAttr.get_query_results_num(resemble_item)
resemble_dict["offline_score"] = 0
resemble_dict["suggest"]["weight"] = 0
data_list.append(resemble_dict)
......
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