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

modify

parent 7641a9e5
......@@ -88,7 +88,7 @@ class TopicUtils(object):
return []
@classmethod
def get_recommend_topic_ids(cls,user_id,offset,size,is_first_time,query=None):
def get_recommend_topic_ids(cls,user_id,offset,size,query=None):
"""
:需增加打散逻辑
:remark:获取首页推荐帖子列表
......@@ -244,17 +244,21 @@ class TopicUtils(object):
q["query"] = dict()
functions_list = [
{
"filter": {"term": {
"group_id": topic_group_id}},
"weight": 1,
},
{
"filter": {"term": {
"user_id": topic_user_id}},
"weight": 1000
}
]
if isinstance(topic_group_id,int) and topic_group_id > 0:
functions_list.append(
{
"filter": {"term": {
"group_id": topic_group_id}},
"weight": 1,
}
)
query_tag_term_list = cls.___get_should_term_list(topic_tag_list)
query_function_score = {
"query":{
......
This diff is collapsed.
......@@ -24,7 +24,11 @@ class TopicTransfer(object):
res["content"] = instance.content
res["content_level"] = instance.content_level
res["user_id"] = instance.user_id
res["group_id"] = instance.group_id
if instance.group:
res["group_id"] = instance.group.id
else:
res["group_id"] = -1
res["share_num"] = instance.share_num
res["pick_id_list"] = instance.get_pick_id_info()
......
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