Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
physical
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpha
physical
Commits
2aab2f63
Commit
2aab2f63
authored
Apr 22, 2019
by
段英荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify topic transfer
parent
5bfa698f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
14 deletions
+20
-14
topic-high-star.json
trans2es/mapping/topic-high-star.json
+2
-1
topic-star-routing.json
trans2es/mapping/topic-star-routing.json
+2
-1
topic.json
trans2es/mapping/topic.json
+2
-1
type_info.py
trans2es/type_info.py
+14
-11
No files found.
trans2es/mapping/topic-high-star.json
View file @
2aab2f63
...
...
@@ -52,6 +52,7 @@
"search_analyzer"
:
"gm_default_index"
},
"is_excellent"
:{
"type"
:
"long"
},
"is_operation_home_recommend"
:
{
"type"
:
"boolean"
}
//是否首页运营推荐
"is_operation_home_recommend"
:
{
"type"
:
"boolean"
},
//是否首页运营推荐
"is_history"
:
{
"type"
:
"boolean"
}
//是否历史数据
}
}
trans2es/mapping/topic-star-routing.json
View file @
2aab2f63
...
...
@@ -52,6 +52,7 @@
"search_analyzer"
:
"gm_default_index"
},
"is_excellent"
:{
"type"
:
"long"
},
"is_operation_home_recommend"
:
{
"type"
:
"boolean"
}
//是否首页运营推荐
"is_operation_home_recommend"
:
{
"type"
:
"boolean"
},
//是否首页运营推荐
"is_history"
:
{
"type"
:
"boolean"
}
//是否历史数据
}
}
trans2es/mapping/topic.json
View file @
2aab2f63
...
...
@@ -52,6 +52,7 @@
"search_analyzer"
:
"gm_default_index"
},
"is_excellent"
:{
"type"
:
"long"
},
"is_operation_home_recommend"
:
{
"type"
:
"boolean"
}
//是否首页运营推荐
"is_operation_home_recommend"
:
{
"type"
:
"boolean"
},
//是否首页运营推荐
"is_history"
:
{
"type"
:
"boolean"
}
//是否历史数据
}
}
trans2es/type_info.py
View file @
2aab2f63
...
...
@@ -84,7 +84,7 @@ class TypeInfo(object):
def
bulk_get_data
(
self
,
instance_iterable
):
data_list
=
[]
# 4
,5星
帖子单独索引
# 4
星以上
帖子单独索引
topic_data_high_star_list
=
list
()
if
self
.
batch_get_data_func
:
...
...
@@ -154,13 +154,16 @@ class TypeInfo(object):
old_data
[
"is_online"
]
=
False
old_data
[
"is_deleted"
]
=
True
old_data
[
"content_level"
]
=
int_ori_topic_star
old_data
[
"is_history"
]
=
True
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"
])
data_list
.
append
(
data
)
# if self.type=="topic" and instance.content_level and int(instance.content_level)>=4:
# topic_data_high_star_list.append(data)
if
data
[
"content_level"
]
>=
4
:
topic_data_high_star_list
.
append
(
data
)
data_list
.
append
(
data
)
return
(
data_list
,
topic_data_high_star_list
)
...
...
@@ -234,13 +237,13 @@ class TypeInfo(object):
es
=
es
,
)
#
#
同时写4星及以上的帖子
#
if len(topic_data_high_star_list)>0:
#
self.elasticsearch_bulk_insert_data(
#
sub_index_name="topic-high-star",
#
data_list=topic_data_high_star_list,
#
es=es,
#
)
# 同时写4星及以上的帖子
if
len
(
topic_data_high_star_list
)
>
0
:
self
.
elasticsearch_bulk_insert_data
(
sub_index_name
=
"topic-high-star"
,
data_list
=
topic_data_high_star_list
,
es
=
es
,
)
end
=
time
.
time
()
time3
=
end
-
begin
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment