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
84eb38b3
Commit
84eb38b3
authored
Jun 17, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改热搜词
parent
ca181dec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
5 deletions
+0
-5
search_hotword.py
search/views/search_hotword.py
+0
-5
No files found.
search/views/search_hotword.py
View file @
84eb38b3
...
...
@@ -33,7 +33,6 @@ def search_hotword(device_id=-1):
"""
try
:
all_tag_name_list
=
set
()
logging
.
info
(
"get redis_client:
%
s"
%
redis_client
)
results_registr_tag
=
json
.
loads
(
redis_client
.
get
(
"physical:search_hotword:results_registr_tag"
))
results_tag
=
json
.
loads
(
redis_client
.
get
(
"physical:search_hotword:results_tag"
))
# 先获取搜索推荐热词
...
...
@@ -52,7 +51,6 @@ def search_hotword(device_id=-1):
if
len
(
all_tag_name_list
)
==
6
or
num
==
results_tag
:
break
logging
.
info
(
"get all_tag_name_list:
%
s"
%
all_tag_name_list
)
# 获取个性化标签
linucb_recommend_redis_prefix
=
"physical:linucb:tag_recommend:device_id:"
tag_recommend_redis_key
=
linucb_recommend_redis_prefix
+
str
(
device_id
)
...
...
@@ -63,8 +61,6 @@ def search_hotword(device_id=-1):
set
(
Tag
.
objects
.
filter
(
id
=
item
,
is_online
=
True
)
.
values_list
(
"name"
,
flat
=
True
)))
all_tag_name_list
.
add
(
results_tag_recommend
[
0
])
if
len
(
all_tag_name_list
)
==
12
:
logging
.
info
(
"get all_tag_name_list:
%
s"
%
all_tag_name_list
)
return
{
"recommend_tag_name"
:
list
(
all_tag_name_list
)}
# 取不够数则取核心标签
...
...
@@ -78,7 +74,6 @@ def search_hotword(device_id=-1):
if
results_tag_hexin
[
0
]
not
in
all_tag_name_list
:
all_tag_name_list
.
add
(
results_tag_hexin
[
0
])
if
len
(
all_tag_name_list
)
>=
12
:
logging
.
info
(
"get all_tag_name_list:
%
s"
%
all_tag_name_list
)
return
{
"recommend_tag_name"
:
list
(
all_tag_name_list
)}
except
:
...
...
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