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
f8fc588d
Commit
f8fc588d
authored
Sep 27, 2019
by
高雅喆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hot fix
parent
b81dca60
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
topic.py
search/views/topic.py
+4
-3
No files found.
search/views/topic.py
View file @
f8fc588d
...
@@ -53,7 +53,7 @@ def get_discover_page_topic_ids(user_id, device_id, size, query_type=TopicPageTy
...
@@ -53,7 +53,7 @@ def get_discover_page_topic_ids(user_id, device_id, size, query_type=TopicPageTy
return
[]
return
[]
def
get_home_recommend_topic_ids
(
user_id
,
device_id
,
tag_id
,
offset
,
underexposure_lin_topic_count
,
size
,
query
=
None
,
def
get_home_recommend_topic_ids
(
user_id
,
device_id
,
tag_id
,
offset
,
underexposure_lin_topic_count
=
0
,
size
=
0
,
query
=
None
,
query_type
=
TopicPageType
.
HOME_RECOMMEND
,
promote_topic_list
=
[],
disable_collpase
=
False
,
query_type
=
TopicPageType
.
HOME_RECOMMEND
,
promote_topic_list
=
[],
disable_collpase
=
False
,
usefulrecall
=-
1
,
useful_tag_list
=
[],
has_score
=
False
,
gray_list
=
[]):
usefulrecall
=-
1
,
useful_tag_list
=
[],
has_score
=
False
,
gray_list
=
[]):
try
:
try
:
...
@@ -141,6 +141,7 @@ def get_home_recommend_topic_ids(user_id, device_id, tag_id, offset, underexposu
...
@@ -141,6 +141,7 @@ def get_home_recommend_topic_ids(user_id, device_id, tag_id, offset, underexposu
# linucb 推荐新帖子
# linucb 推荐新帖子
if
linucb_recommend_tags
:
if
linucb_recommend_tags
:
linucb_recommend_tags_set_tags
=
get_same_tagset_ids
(
linucb_recommend_tags
)
linucb_recommend_tags_set_tags
=
get_same_tagset_ids
(
linucb_recommend_tags
)
if
underexposure_lin_topic_count
:
underexposure_lin_topic_ids
=
ESPerform
.
get_tag_new_topic_list
(
linucb_recommend_tags_set_tags
,
have_read_topic_id_list
,
underexposure_lin_topic_count
)
underexposure_lin_topic_ids
=
ESPerform
.
get_tag_new_topic_list
(
linucb_recommend_tags_set_tags
,
have_read_topic_id_list
,
underexposure_lin_topic_count
)
size
=
size
-
len
(
underexposure_lin_topic_ids
)
size
=
size
-
len
(
underexposure_lin_topic_ids
)
have_read_topic_id_list
.
extend
(
underexposure_lin_topic_ids
)
have_read_topic_id_list
.
extend
(
underexposure_lin_topic_ids
)
...
@@ -570,10 +571,10 @@ def home_query(device_id="", tag_id=-1, user_id=-1, query="", offset=0, size=10,
...
@@ -570,10 +571,10 @@ def home_query(device_id="", tag_id=-1, user_id=-1, query="", offset=0, size=10,
if
not
isinstance
(
device_id
,
str
):
if
not
isinstance
(
device_id
,
str
):
device_id
=
""
device_id
=
""
recommend_topic_list
,
rank_topic_id_list
=
get_home_recommend_topic_ids
(
user_id
,
device_id
,
tag_id
,
unexposure_lin_topic
,
recommend_topic_list
,
rank_topic_id_list
=
get_home_recommend_topic_ids
(
user_id
,
device_id
,
tag_id
,
offset
=
offset
,
size
=
size
,
query
=
query
)
offset
=
offset
,
size
=
size
,
query
=
query
)
if
len
(
rank_topic_id_list
)
>
0
and
len
(
rank_topic_id_list
)
<
size
:
if
len
(
rank_topic_id_list
)
>
0
and
len
(
rank_topic_id_list
)
<
size
:
recommend_topic_list
,
rank_topic_id_list
=
get_home_recommend_topic_ids
(
user_id
,
device_id
,
tag_id
,
unexposure_lin_topic
,
recommend_topic_list
,
rank_topic_id_list
=
get_home_recommend_topic_ids
(
user_id
,
device_id
,
tag_id
,
offset
=
offset
,
size
=
size
,
offset
=
offset
,
size
=
size
,
query
=
query
,
disable_collpase
=
True
)
query
=
query
,
disable_collpase
=
True
)
...
...
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