Commit 8f97c7bf authored by 高雅喆's avatar 高雅喆

Merge branch 'gyz_topic_ctr_all' into 'master'

lin回答和lin问题的排序逻辑更改(30天内和历史)

See merge request !509
parents ff979cae 379d23ba
......@@ -415,14 +415,14 @@ class ESPerform(object):
}
},
"_source": {
"include": ["id", "user_id", "latest_reply_time", "topic_ctr_30", "like_rate_30"]
"include": ["id", "user_id", "latest_reply_time", "topic_ctr_30", "topic_ctr_all", "like_rate_30", "like_rate_all"]
},
"sort": [
{
"_script": {
"order": "desc",
"script": {
"inline": "5*doc['topic_ctr_30'].value+doc['like_rate_30'].value"
"inline": "10*doc['topic_ctr_30'].value+doc['like_rate_30'].value+2*doc.['topic_ctr_all']+doc['like_rate_all']"
},
"type": "number"
}
......@@ -452,16 +452,7 @@ class ESPerform(object):
topic_id_dict = dict()
for item in result_dict["hits"]:
topic_id_dict[str(item["_source"]["id"])] = item["_source"]["user_id"]
topic_id_dict_latest_reply_time = list()
for item in result_dict["hits"]:
topic_id_dict_latest_reply_time.append([item["_source"]["id"], item["_source"]["latest_reply_time"]])
logging.info("topic_id_list:%s" % str(topic_id_dict))
logging.info("get_tag_topic_list_dict:gyz" + str(q) + str(result_dict))
logging.info("linucb_tag_id_list_2_same_tagset_ids_2_topics_detail:" + str(topic_id_dict_latest_reply_time))
return topic_id_list, topic_id_dict
except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
......@@ -548,9 +539,18 @@ class ESPerform(object):
}
},
"_source": {
"include": ["id"]
"include": ["id", "real_user_activate_time", "create_time", "pictorial_ctr_30", "pictorial_ctr_all", "like_rate_30", "like_rate_all"]
},
"sort": [
{
"_script": {
"order": "desc",
"script": {
"inline": "5*doc['pictorial_ctr_30'].value+3*doc['like_rate_30'].value+doc.['pictorial_ctr_all']+doc['like_rate_all']"
},
"type": "number"
}
},
{"real_user_activate_time": {"order": "desc"}},
{"create_time": {"order": "desc"}},
],
......@@ -567,8 +567,7 @@ class ESPerform(object):
offset=0, size=size)
pictorial_id_list = [item["_source"]["id"] for item in result_dict["hits"]]
# logging.info("topic_id_list:%s" % str(topic_id_list))
# topic_id_dict = [{str(item["_source"]["id"]):item["_source"]["user_id"]} for item in result_dict["hits"]]
logging.info("get_tag_pictorial_id_list:gyz" + str(q) + str(result_dict))
return pictorial_id_list
except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
......
......@@ -66,5 +66,5 @@ def is_connection_usable():
connection.connection.ping()
return True
except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
# logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return False
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