Commit 1fc8d9b7 authored by 段英荣's avatar 段英荣

modify

parent e37df867
...@@ -109,23 +109,32 @@ class TopicUtils(object): ...@@ -109,23 +109,32 @@ class TopicUtils(object):
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_chinese_user_id_list, attention_japan_user_id_list, (attention_chinese_user_id_list, attention_japan_user_id_list,
attention_korea_user_id_list) = TopicUtils.analyze_related_user_id_list( attention_korea_user_id_list) = TopicUtils.analyze_related_user_id_list(
related_user_id_list=attention_user_info_list) related_user_id_list=attention_user_info_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_chinese_user_id_list, pick_japan_user_id_list, (pick_chinese_user_id_list, pick_japan_user_id_list,
pick_korea_user_id_list) = TopicUtils.analyze_related_user_id_list(pick_user_info_list) pick_korea_user_id_list) = TopicUtils.analyze_related_user_id_list(pick_user_info_list)
"""
same_group_user_info_list = result_dict["hits"][0]["_source"]["same_group_user_id_list"] same_group_user_info_list = result_dict["hits"][0]["_source"]["same_group_user_id_list"]
same_group_id_list = [item["user_id"] for item in same_group_user_info_list]
"""
(same_group_chinese_user_id_list, same_group_japan_user_id_list, (same_group_chinese_user_id_list, same_group_japan_user_id_list,
same_group_korea_user_id_list) = TopicUtils.analyze_related_user_id_list(same_group_user_info_list) same_group_korea_user_id_list) = TopicUtils.analyze_related_user_id_list(same_group_user_info_list)
"""
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,field_name="user_id") attention_user_id_term_list = cls.___get_should_term_list(attention_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,field_name="user_id") pick_user_id_term_list = cls.___get_should_term_list(pick_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,field_name="user_id") same_group_user_id_term_list = cls.___get_should_term_list(same_group_id_list,field_name="user_id")
q = dict() q = dict()
q["query"] = dict() q["query"] = dict()
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"is_deleted":{"type":"boolean"}, "is_deleted":{"type":"boolean"},
"tag_list":{"type":"long"},//标签属性 "tag_list":{"type":"long"},//标签属性
"city_id":{"type":"text"}, "city_id":{"type":"text"},
"country_id":{"type":"long"}, "country_id":{"type":"text"},
"is_recommend":{"type":"boolean"},//是否运营推荐用户 "is_recommend":{"type":"boolean"},//是否运营推荐用户
"is_shadow":{"type":"boolean"},//是否马甲用户 "is_shadow":{"type":"boolean"},//是否马甲用户
"latest_topic_time_val":{"type":"long"},//最近发帖时间 "latest_topic_time_val":{"type":"long"},//最近发帖时间
...@@ -18,21 +18,21 @@ ...@@ -18,21 +18,21 @@
"type":"nested", "type":"nested",
"properties":{ "properties":{
"user_id":{"type":"long"}, "user_id":{"type":"long"},
"country_id":{"type":"long"} "country_id":{"type":"text"}
} }
}, },
"pick_user_id_list":{//pick用户列表 "pick_user_id_list":{//pick用户列表
"type":"nested", "type":"nested",
"properties":{ "properties":{
"user_id":{"type":"long"}, "user_id":{"type":"long"},
"country_id":{"type":"long"} "country_id":{"type":"text"}
} }
}, },
"same_group_user_id_list":{//同组用户列表 "same_group_user_id_list":{//同组用户列表
"type":"nested", "type":"nested",
"properties":{ "properties":{
"user_id":{"type":"long"}, "user_id":{"type":"long"},
"country_id":{"type":"long"} "country_id":{"type":"text"}
} }
}, },
"attention_group_id_list":{//关注小组列表 "attention_group_id_list":{//关注小组列表
......
...@@ -27,8 +27,8 @@ class User(models.Model): ...@@ -27,8 +27,8 @@ class User(models.Model):
nick_name = models.CharField(verbose_name=u'昵称', max_length=255, default='') nick_name = models.CharField(verbose_name=u'昵称', max_length=255, default='')
profile_pic = models.CharField(verbose_name=u'头像', max_length=300) profile_pic = models.CharField(verbose_name=u'头像', max_length=300)
gender = models.SmallIntegerField(verbose_name=u'性别') gender = models.SmallIntegerField(verbose_name=u'性别')
city_id = models.CharField(verbose_name=u'城市id', max_length=40) city_id = models.CharField(verbose_name=u'城市id', max_length=60)
country_id = models.IntegerField(verbose_name='国家id') country_id = models.CharField(verbose_name='国家id', max_length=40)
is_online = models.BooleanField(verbose_name="是否上线") is_online = models.BooleanField(verbose_name="是否上线")
is_deleted = models.BooleanField(verbose_name='是否删除') is_deleted = models.BooleanField(verbose_name='是否删除')
create_time = models.DateTimeField(verbose_name=u'创建时间',default=datetime.datetime.fromtimestamp(0)) create_time = models.DateTimeField(verbose_name=u'创建时间',default=datetime.datetime.fromtimestamp(0))
......
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