Commit 074d6891 authored by 段英荣's avatar 段英荣

modify

parent ac5effe0
......@@ -140,21 +140,6 @@ class TopicUtils(object):
q["query"] = dict()
functions_list = [
{
"filter": {"bool": {
"should": attention_user_id_term_list}},
"weight": 5,
},
{
"filter": {"bool": {
"should": pick_user_id_term_list}},
"weight": 3
},
{
"filter": {"bool": {
"should": same_group_user_id_term_list}},
"weight": 2
},
{
"gauss": {
"update_time": {
......@@ -165,6 +150,31 @@ class TopicUtils(object):
}
]
if len(attention_user_id_term_list)>0:
functions_list.append(
{
"filter": {"bool": {
"should": attention_user_id_term_list}},
"weight": 3,
}
)
elif len(pick_user_id_term_list)>0:
functions_list.append(
{
"filter": {"bool": {
"should": pick_user_id_term_list}},
"weight": 2
}
)
elif len(same_group_user_id_term_list)>0:
functions_list.append(
{
"filter": {"bool": {
"should": same_group_user_id_term_list}},
"weight": 1
}
)
query_tag_term_list = cls.___get_should_term_list(user_tag_list)
query_function_score = {
"query": {
......@@ -175,8 +185,8 @@ class TopicUtils(object):
}
}
},
"score_mode": "max",
"boost_mode": "replace",
"score_mode": "sum",
"boost_mode": "sum",
"functions": functions_list
}
......
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