Commit 5b2ccd2b authored by 段英荣's avatar 段英荣

modify home_recommend rank

parent 1807fee2
...@@ -121,6 +121,7 @@ class TopicUtils(object): ...@@ -121,6 +121,7 @@ class TopicUtils(object):
same_group_user_info_list = result_dict["hits"][0]["_source"]["same_group_user_id_list"] same_group_user_info_list = result_dict["hits"][0]["_source"]["same_group_user_id_list"]
same_group_id_list = [item["user_id"] for item in same_group_user_info_list] same_group_id_list = [item["user_id"] for item in same_group_user_info_list]
same_group_id_list = same_group_id_list[:1000]
user_tag_list = result_dict["hits"][0]["_source"]["tag_list"] user_tag_list = result_dict["hits"][0]["_source"]["tag_list"]
...@@ -136,20 +137,20 @@ class TopicUtils(object): ...@@ -136,20 +137,20 @@ class TopicUtils(object):
"gauss": { "gauss": {
"update_time": { "update_time": {
"scale": "1d", "scale": "1d",
"decay": 0.9 "decay": 0.999
} }
}, },
"weight": 5 "weight": 5
},
{
"gauss": {
"create_time": {
"scale": "1d",
"decay": 0.9
}
},
"weight": 10
} }
# {
# "gauss": {
# "create_time": {
# "scale": "1d",
# "decay": 0.9
# }
# },
# "weight": 10
# }
] ]
if len(attention_user_id_list)>0: if len(attention_user_id_list)>0:
...@@ -242,7 +243,7 @@ class TopicUtils(object): ...@@ -242,7 +243,7 @@ class TopicUtils(object):
"type":"number", "type":"number",
"script":{ "script":{
"lang": "expression", "lang": "expression",
"source": "_score*doc['offline_score']" "source": "_score+doc['offline_score']"
# "lang":"painless", # "lang":"painless",
# "source":"_score+params._source.offline_score" # "source":"_score+params._source.offline_score"
}, },
......
...@@ -135,9 +135,9 @@ class Topic(models.Model): ...@@ -135,9 +135,9 @@ class Topic(models.Model):
#帖子等级 #帖子等级
if self.content_level == '5': if self.content_level == '5':
offline_score += 5.0 offline_score += 6.0
elif self.content_level == '4': elif self.content_level == '4':
offline_score += 3.0 offline_score += 5.0
elif self.content_level == '3': elif self.content_level == '3':
offline_score += 2.0 offline_score += 2.0
......
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