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

modify

parent d12ff70d
......@@ -99,20 +99,20 @@ class TopicUtils(object):
return {"recommend_topic_ids": []}
logging.info("duan add,result_dict:%s" % str(result_dict).encode("utf-8"))
attention_user_info_list = result_dict["hits"][0]["attention_user_id_list"]
attention_user_info_list = result_dict["hits"][0]["_source"]["attention_user_id_list"]
(attention_chinese_user_id_list, attention_japan_user_id_list,
attention_korea_user_id_list) = TopicUtils.analyze_related_user_id_list(
related_user_id_list=attention_user_info_list)
pick_user_info_list = result_dict["hits"][0]["pick_user_id_list"]
pick_user_info_list = result_dict["hits"][0]["_source"]["pick_user_id_list"]
(pick_chinese_user_id_list, pick_japan_user_id_list,
pick_korea_user_id_list) = TopicUtils.analyze_related_user_id_list(pick_user_info_list)
same_group_user_info_list = result_dict["hits"][0]["same_group_user_id_list"]
same_group_user_info_list = result_dict["hits"][0]["_source"]["same_group_user_id_list"]
(same_group_chinese_user_id_list, same_group_japan_user_id_list,
same_group_korea_user_id_list) = TopicUtils.analyze_related_user_id_list(same_group_user_info_list)
user_tag_list = result_dict["hits"][0]["tag_list"]
user_tag_list = result_dict["hits"][0]["_source"]["tag_list"]
q = dict()
q["filter"] = {
......
......@@ -20,10 +20,10 @@ def home_recommend(user_id=-1,offset=0,size=10):
redis_key = "physical:home_recommend:" + "user_id:" + str(user_id)
redis_val_dict = redis_client.hgetall(redis_key)
if len(redis_val_dict) > 0:
group_topic_ids = json.loads(redis_val_dict["group_topic_ids"])
not_group_topic_ids = json.loads(redis_val_dict["not_group_topic_ids"])
group_topic_ids_index = redis_val_dict["group_topic_ids_index"]
not_group_topic_ids_index = redis_val_dict["not_group_topic_ids_index"]
group_topic_ids = json.loads(redis_val_dict[b"group_topic_ids"])
not_group_topic_ids = json.loads(redis_val_dict[b"not_group_topic_ids"])
group_topic_ids_index = redis_val_dict[b"group_topic_ids_index"]
not_group_topic_ids_index = redis_val_dict[b"not_group_topic_ids_index"]
if len(group_topic_ids) < (size-1) or len(not_group_topic_ids) < 1:
if len(group_topic_ids) < (size-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