Commit 42514adb authored by 段英荣's avatar 段英荣

modify

parent e79705ed
......@@ -120,7 +120,7 @@ class TopicUtils(object):
return {}
@classmethod
def get_recommend_topic_ids(cls,user_id,tag_id,offset,size,single_size,query=None,query_type=TopicPageType.FIND_PAGE,
def get_recommend_topic_ids(cls,user_id,tag_id,offset,size,single_size,query=None,query_type=TopicPageType.HOME_RECOMMEND,
filter_topic_id_list=[],test_score=False,must_topic_id_list=[],recommend_tag_list=[],
user_similar_score_list=[],index_type="topic",routing=None,attention_tag_list=[],linucb_user_id_list = [],disable_collpase=False):
"""
......@@ -305,9 +305,14 @@ class TopicUtils(object):
query_function_score["query"]["bool"]["must_not"] = [
{"term": {"is_operation_home_recommend": True}}
]
query_function_score["query"]["bool"]["filter"].append(
{"term": {"content_level": 6}}
)
if query_type == TopicPageType.FIND_PAGE:
query_function_score["query"]["bool"]["filter"].append(
{"range": {"content_level": {"gte": 4, "lte": 6}}}
)
else:
query_function_score["query"]["bool"]["filter"].append(
{"term": {"content_level": 6}}
)
q["query"]["function_score"] = query_function_score
if not disable_collpase:
q["collapse"] = {
......
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