Commit 7e9f44e8 authored by Kai's avatar Kai

update

parent 27be356a
...@@ -35,7 +35,7 @@ class TopicUtils(object): ...@@ -35,7 +35,7 @@ class TopicUtils(object):
} }
q["_source"] = { q["_source"] = {
"include": ["tag_list","useful_tag_list","attention_user_id_list", "pick_user_id_list", "same_pictorial_user_id_list"] "include": ["tag_list","attention_user_id_list", "pick_user_id_list", "same_pictorial_user_id_list"]
} }
result_dict = ESPerform.get_search_results(ESPerform.get_cli(), "user", q, offset, size) result_dict = ESPerform.get_search_results(ESPerform.get_cli(), "user", q, offset, size)
...@@ -141,14 +141,12 @@ class TopicUtils(object): ...@@ -141,14 +141,12 @@ class TopicUtils(object):
# pick_user_id_list = list() # pick_user_id_list = list()
# same_group_id_list = list() # same_group_id_list = list()
user_tag_list = list() user_tag_list = list()
useful_tag_id_list = list()
result_dict = TopicUtils.get_related_user_info(user_id, 0, 1) result_dict = TopicUtils.get_related_user_info(user_id, 0, 1)
if len(result_dict["hits"]) == 0: if len(result_dict["hits"]) == 0:
logging.warning("not find user_id:%d in es!" % int(user_id)) logging.warning("not find user_id:%d in es!" % int(user_id))
else: else:
attention_user_info_list = result_dict["hits"][0]["_source"]["attention_user_id_list"] attention_user_info_list = result_dict["hits"][0]["_source"]["attention_user_id_list"]
attention_user_id_list = [item["user_id"] for item in attention_user_info_list] attention_user_id_list = [item["user_id"] for item in attention_user_info_list]
useful_tag_id_list = result_dict["hits"][0]["_source"]["useful_tag_list"]
# pick_user_info_list = result_dict["hits"][0]["_source"]["pick_user_id_list"] # pick_user_info_list = result_dict["hits"][0]["_source"]["pick_user_id_list"]
# pick_user_id_list = [item["user_id"] for item in pick_user_info_list] # pick_user_id_list = [item["user_id"] for item in pick_user_info_list]
...@@ -197,14 +195,6 @@ class TopicUtils(object): ...@@ -197,14 +195,6 @@ class TopicUtils(object):
"weight": 100 "weight": 100
} }
) )
if len(useful_tag_id_list) > 0 and usefulrecall!= -1:
functions_list.append(
{
"filter": {"bool": {
"must": {"terms": {"tag_list": useful_tag_id_list}}}},
"weight": 100
}
)
query_function_score = { query_function_score = {
"query": { "query": {
"bool": { "bool": {
......
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