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
50c4cfb6
Commit
50c4cfb6
authored
Apr 18, 2019
by
Kai
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into hk
parents
fa3fd1b2
c4ce62ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
topic.py
search/views/topic.py
+3
-2
No files found.
search/views/topic.py
View file @
50c4cfb6
...
...
@@ -78,6 +78,7 @@ def get_home_recommend_topic_ids(user_id, device_id, tag_id, offset, size, query
user_similar_score_redis_list
=
json
.
loads
(
redis_user_similar_score_redis_val
)
if
redis_user_similar_score_redis_val
else
[]
attention_tag_list
=
list
()
recommend_topic_list
=
list
()
if
query
is
None
:
# linucb 推荐帖子
...
...
@@ -110,7 +111,7 @@ def get_home_recommend_topic_ids(user_id, device_id, tag_id, offset, size, query
# have_read_topic_id_list_add_promote.append(topic_id)
topic_id_list
=
list
()
rank_topic_id_list
=
TopicUtils
.
get_recommend_topic_ids
(
user_id
=
user_id
,
tag_id
=
tag_id
,
offset
=
offset
,
size
=
size
,
rank_topic_id_list
=
TopicUtils
.
get_recommend_topic_ids
(
user_id
=
user_id
,
tag_id
=
tag_id
,
offset
=
0
,
size
=
size
,
single_size
=
size
,
query
=
query
,
query_type
=
query_type
,
filter_topic_id_list
=
have_read_topic_id_list
,
user_similar_score_list
=
user_similar_score_redis_list
,
index_type
=
"topic"
,
routing
=
"4,5,6"
,
attention_tag_list
=
attention_tag_list
)
...
...
@@ -243,7 +244,7 @@ def home_query(device_id="", tag_id=-1, user_id=-1, query="", offset=0, size=10)
if
not
isinstance
(
device_id
,
str
):
device_id
=
""
recommend_topic_ids
=
get_home_recommend_topic_ids
(
user_id
,
device_id
,
tag_id
,
offset
,
size
,
query
)
recommend_topic_ids
=
get_home_recommend_topic_ids
(
user_id
,
device_id
,
tag_id
,
offset
=
offset
,
size
=
size
,
query
=
query
)
return
{
"recommend_topic_ids"
:
recommend_topic_ids
}
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
...
...
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