Commit 80bdfa35 authored by Kai's avatar Kai

Merge branch 'master' into hk

parents 4a9fdf57 a7252c7f
......@@ -259,9 +259,7 @@ class CollectData(object):
else:
tagid_list = list()
logging.warning("unknown type msg:%s" % raw_val_dict.get("type", "missing type"))
logging.info(
"consume click topic_id:%s,device_id:%s" % (
str(tagid_list), str(device_id)))
device_id = raw_val_dict["device"]["device_id"]
user_id = raw_val_dict["user_id"] if "user_id" in raw_val_dict else None
......
......@@ -182,14 +182,6 @@ class TopicUtils(object):
}
},
"weight": 1000
},
{
"filter": {
"term": {
"is_excellent": 1
}
},
"weight": 500
}
]
......
......@@ -155,12 +155,12 @@ def choice_push_tag(device_id, user_id):
@bind("physical/search/identity_tag_name")
def identity_tag_name(topic_content):
try:
ret_tag_list = list()
ret_tag_set = set()
redis_key_name = "physical:tag_name_set"
body = {
'text': topic_content,
'analyzer': "gm_default_search"
'analyzer': "gm_default_index"
}
cli_info = settings.TAG_ES_INFO_LIST
......@@ -171,9 +171,9 @@ def identity_tag_name(topic_content):
token_word = item["token"]
is_member = redis_client.sismember(redis_key_name, token_word)
if is_member:
ret_tag_list.append(token_word)
ret_tag_set.add(token_word)
return {"tag_name_list": ret_tag_list}
return {"tag_name_list": list(ret_tag_set)}
except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return {"tag_name_list": []}
......
......@@ -209,7 +209,7 @@ class Topic(models.Model):
user_query_results = UserExtra.objects.using(settings.SLAVE_DB_NAME).filter(user_id=self.user_id)
if user_query_results.count() > 0:
if user_query_results[0].is_recommend:
offline_score += 2.0
offline_score += 2.0 *10
elif user_query_results[0].is_shadow:
user_is_shadow = True
......@@ -219,18 +219,18 @@ class Topic(models.Model):
# 帖子等级
if self.content_level == '5':
offline_score += 6.0
offline_score += 100.0 *3
elif self.content_level == '4':
offline_score += 5.0
offline_score += 60.0 *3
elif self.content_level == '6':
offline_score += 400.0
offline_score += 200.0 *3
is_excellent = self.judge_if_excellent_topic(self.id)
if is_excellent:
offline_score += 200.0
# is_excellent = self.judge_if_excellent_topic(self.id)
# if is_excellent:
# offline_score += 200.0
if self.language_type == 1:
offline_score += 100.0
offline_score += 60.0
# exposure_count = ActionSumAboutTopic.objects.using(settings.SLAVE_DB_NAME).filter(topic_id=self.id, data_type=1).count()
# click_count = ActionSumAboutTopic.objects.using(settings.SLAVE_DB_NAME).filter(topic_id=self.id, data_type=2).count()
# uv_num = ActionSumAboutTopic.objects.using(settings.SLAVE_DB_NAME).filter(topic_id=self.id, data_type=3).count()
......
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