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

modify

parent 4adc2d99
...@@ -72,13 +72,13 @@ class TopicUtils(object): ...@@ -72,13 +72,13 @@ class TopicUtils(object):
return False return False
@classmethod @classmethod
def ___get_should_term_list(cls,ori_list): def ___get_should_term_list(cls,ori_list,field_name="tag_list"):
try: try:
should_term_list = list() should_term_list = list()
for term_id in ori_list: for term_id in ori_list:
term_dict = { term_dict = {
"term":{ "term":{
"tag_list":{"value":term_id} field_name:{"value":term_id}
} }
} }
should_term_list.append(term_dict) should_term_list.append(term_dict)
...@@ -123,9 +123,9 @@ class TopicUtils(object): ...@@ -123,9 +123,9 @@ class TopicUtils(object):
user_tag_list = result_dict["hits"][0]["_source"]["tag_list"] user_tag_list = result_dict["hits"][0]["_source"]["tag_list"]
attention_user_id_term_list = cls.___get_should_term_list(attention_chinese_user_id_list + attention_japan_user_id_list + attention_korea_user_id_list) attention_user_id_term_list = cls.___get_should_term_list(attention_chinese_user_id_list + attention_japan_user_id_list + attention_korea_user_id_list,field_name="user_id")
pick_user_id_term_list = cls.___get_should_term_list(pick_chinese_user_id_list + pick_japan_user_id_list + pick_korea_user_id_list) pick_user_id_term_list = cls.___get_should_term_list(pick_chinese_user_id_list + pick_japan_user_id_list + pick_korea_user_id_list,field_name="user_id")
same_group_user_id_term_list = cls.___get_should_term_list(same_group_chinese_user_id_list + same_group_japan_user_id_list + same_group_korea_user_id_list) same_group_user_id_term_list = cls.___get_should_term_list(same_group_chinese_user_id_list + same_group_japan_user_id_list + same_group_korea_user_id_list,field_name="user_id")
q = dict() q = dict()
q["query"] = dict() q["query"] = dict()
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
import logging import logging
import traceback import traceback
import json import json
import time
from libs.es import ESPerform from libs.es import ESPerform
...@@ -83,6 +84,7 @@ class UserUtils(object): ...@@ -83,6 +84,7 @@ class UserUtils(object):
{ {
"gauss": { "gauss": {
"latest_topic_time_val": { "latest_topic_time_val": {
"origin": int(time.time()),
"scale": "600", "scale": "600",
"decay": 0.1 "decay": 0.1
} }
......
...@@ -15,7 +15,7 @@ from search.utils.common import * ...@@ -15,7 +15,7 @@ from search.utils.common import *
@bind("physical/search/recommend_user") @bind("physical/search/recommend_user")
def recommend_user(self_user_id,interesting_user_id,offset=0,size=10): def recommend_user(self_user_id,interesting_user_id,offset=0,size=10):
""" """
:remark 点关注推荐用户,缺少按时间排序策略 :remark 点关注推荐用户
:param self_user_id: :param self_user_id:
:param interesting_user_id: :param interesting_user_id:
:param offset: :param offset:
......
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