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
吴升宇
physical
Commits
e02d6883
Commit
e02d6883
authored
Jun 17, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
60ad98b0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
tasks.py
injection/data_sync/tasks.py
+4
-3
search_hotword.py
search/views/search_hotword.py
+1
-0
No files found.
injection/data_sync/tasks.py
View file @
e02d6883
...
@@ -109,15 +109,16 @@ def sync_user_similar_score():
...
@@ -109,15 +109,16 @@ def sync_user_similar_score():
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
@shared_task
@shared_task
def
get_tag_count
():
def
get_tag_count
():
try
:
try
:
# 获取搜索推荐热词
# 获取搜索推荐热词
results_registr_tag
=
list
(
set
(
RegisterShowTag
.
objects
.
filter
(
is_deleted
=
False
,
is_online
=
1
)
.
values_list
(
"tag_id"
,
flat
=
True
)))
results_registr_tag
=
list
(
set
(
RegisterShowTag
.
objects
.
filter
(
is_deleted
=
False
,
is_online
=
1
)
.
values_list
(
"tag_id"
,
flat
=
True
)))
# 获取符合条件的核心词
# 获取符合条件的核心词
results_tag
=
list
(
set
(
Tag
.
objects
.
filter
(
is_online
=
True
,
is_deleted
=
False
,
collection
=
1
)
.
values_list
(
"id"
,
flat
=
True
)))
results_tag
=
list
(
set
(
Tag
.
objects
.
filter
(
is_online
=
True
,
is_deleted
=
False
,
collection
=
1
)
.
values_list
(
"id"
,
flat
=
True
)))
redis_registr_tag
=
"physical:search_hotword:results_registr_tag"
redis_registr_tag
=
"physical:search_hotword:results_registr_tag"
redis_tag
=
"physical:search_hotword:results_tag"
redis_tag
=
"physical:search_hotword:results_tag"
...
...
search/views/search_hotword.py
View file @
e02d6883
...
@@ -59,6 +59,7 @@ def search_hotword(device_id=-1):
...
@@ -59,6 +59,7 @@ def search_hotword(device_id=-1):
for
item
in
linucb_recommend_tag_list
:
for
item
in
linucb_recommend_tag_list
:
results_tag_recommend
=
list
(
results_tag_recommend
=
list
(
set
(
Tag
.
objects
.
filter
(
id
=
item
,
is_online
=
True
)
.
values_list
(
"name"
,
flat
=
True
)))
set
(
Tag
.
objects
.
filter
(
id
=
item
,
is_online
=
True
)
.
values_list
(
"name"
,
flat
=
True
)))
if
results_tag_recommend
:
all_tag_name_list
.
add
(
results_tag_recommend
[
0
])
all_tag_name_list
.
add
(
results_tag_recommend
[
0
])
if
len
(
all_tag_name_list
)
==
12
:
if
len
(
all_tag_name_list
)
==
12
:
return
{
"recommend_tag_name"
:
list
(
all_tag_name_list
)}
return
{
"recommend_tag_name"
:
list
(
all_tag_name_list
)}
...
...
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