Commit 2aab2f63 authored by 段英荣's avatar 段英荣

modify topic transfer

parent 5bfa698f
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
"search_analyzer": "gm_default_index" "search_analyzer": "gm_default_index"
}, },
"is_excellent":{"type": "long"}, "is_excellent":{"type": "long"},
"is_operation_home_recommend": {"type": "boolean"} //是否首页运营推荐 "is_operation_home_recommend": {"type": "boolean"}, //是否首页运营推荐
"is_history": {"type": "boolean"} //是否历史数据
} }
} }
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
"search_analyzer": "gm_default_index" "search_analyzer": "gm_default_index"
}, },
"is_excellent":{"type": "long"}, "is_excellent":{"type": "long"},
"is_operation_home_recommend": {"type": "boolean"} //是否首页运营推荐 "is_operation_home_recommend": {"type": "boolean"}, //是否首页运营推荐
"is_history": {"type": "boolean"} //是否历史数据
} }
} }
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
"search_analyzer": "gm_default_index" "search_analyzer": "gm_default_index"
}, },
"is_excellent":{"type": "long"}, "is_excellent":{"type": "long"},
"is_operation_home_recommend": {"type": "boolean"} //是否首页运营推荐 "is_operation_home_recommend": {"type": "boolean"}, //是否首页运营推荐
"is_history": {"type": "boolean"} //是否历史数据
} }
} }
...@@ -84,7 +84,7 @@ class TypeInfo(object): ...@@ -84,7 +84,7 @@ class TypeInfo(object):
def bulk_get_data(self, instance_iterable): def bulk_get_data(self, instance_iterable):
data_list = [] data_list = []
# 4,5星帖子单独索引 # 4星以上帖子单独索引
topic_data_high_star_list = list() topic_data_high_star_list = list()
if self.batch_get_data_func: if self.batch_get_data_func:
...@@ -154,13 +154,16 @@ class TypeInfo(object): ...@@ -154,13 +154,16 @@ class TypeInfo(object):
old_data["is_online"] = False old_data["is_online"] = False
old_data["is_deleted"] = True old_data["is_deleted"] = True
old_data["content_level"] = int_ori_topic_star old_data["content_level"] = int_ori_topic_star
old_data["is_history"] = True
data_list.append(old_data) data_list.append(old_data)
if int_ori_topic_star>=4:
topic_data_high_star_list.append(old_data)
redis_client.hset(self.physical_topic_star, data["id"], data["content_level"]) redis_client.hset(self.physical_topic_star, data["id"], data["content_level"])
data_list.append(data)
# if self.type=="topic" and instance.content_level and int(instance.content_level)>=4: if data["content_level"]>=4:
# topic_data_high_star_list.append(data) topic_data_high_star_list.append(data)
data_list.append(data)
return (data_list,topic_data_high_star_list) return (data_list,topic_data_high_star_list)
...@@ -234,13 +237,13 @@ class TypeInfo(object): ...@@ -234,13 +237,13 @@ class TypeInfo(object):
es=es, es=es,
) )
# # 同时写4星及以上的帖子 # 同时写4星及以上的帖子
# if len(topic_data_high_star_list)>0: if len(topic_data_high_star_list)>0:
# self.elasticsearch_bulk_insert_data( self.elasticsearch_bulk_insert_data(
# sub_index_name="topic-high-star", sub_index_name="topic-high-star",
# data_list=topic_data_high_star_list, data_list=topic_data_high_star_list,
# es=es, es=es,
# ) )
end = time.time() end = time.time()
time3=end-begin time3=end-begin
......
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