Commit fb407d15 authored by 李小芳's avatar 李小芳

add

parent 13179ecf
......@@ -16,26 +16,13 @@ from pypinyin import pinyin, lazy_pinyin
def get_suggest_tips(query, lat, lng, offset=0, size=50, device_id=None):
"""
这个地方目前是有三个逻辑 分两个灰度验证
50%前段强加权后根据tab转化率和词频进行排序 索引 suggest gray_number=1 尾号["0", "1", "2", "3", "c", "d", "e", "f"]
25%去掉前段强加权后 直接根据tag转化率和词频进行排序 suggest-v1 gray_number=2 尾号["4", "5", "6", "a"]
25%去掉前段强加权后 根据tag转化率和词频进行排序 再根据前段加权展示排序 suggest-v1 gray_number=3 尾号["9", "8", "7", "b"]
:param query:
:param lat:
:param lng:
:param offset:
:param size:
:param device_id:
:return:
"""
""" """
try:
gray_number = 1
###在原来的逻辑上加两层灰度
if device_id in ["057F28DF-20B8-488F-A285-931367FCC110"]:
sub_index_name = "suggest-v1"
else:
sub_index_name = "suggest"
......@@ -204,7 +191,8 @@ def get_query_by_es(query='', lat=0, lng=0, size=0, offset=0, highlight_query=No
ret_list = list()
doctor_hospital_equal_query = list()
tag_equal_query = list()
result_dict = ESPerform.get_search_results(ESPerform.get_cli(), sub_index_name=sub_index_name, query_body=q,offset=offset, size=size, is_suggest_request=True)
result_dict = ESPerform.get_search_results(ESPerform.get_cli(), sub_index_name=sub_index_name, query_body=q,
offset=offset, size=size, is_suggest_request=True)
for tips_item in result_dict["suggest"]["tips-suggest"]:
for hit_item in tips_item["options"]:
hit_item["_source"]["ori_name"] = hit_item["_source"]["ori_name"].replace("超声刀", "超声提升")
......
......@@ -118,10 +118,14 @@ def get_tips_suggest_list(instance_cn_name):
def get_tips_suggest_list_v1(instance_cn_name):
try:
# ch_full_weight = 6.0 * 1000
# py_full_weight = 3.0 * 1000
full_weight = 1
py_acronym_full_weight = 1
ch_full_weight = 6.0 * 1000
py_full_weight = 3.0 * 1000
if instance_cn_name in ["AI测颜值", "AI测肤质", "ai测颜值", "ai测肤质"]:
full_weight = 10000000
py_acronym_full_weight = 1
else:
full_weight = 1
py_acronym_full_weight = 1
py_acronym_prefix_weight = 1
ch_prefix_weight = 1
......
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