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
42514adb
Commit
42514adb
authored
May 13, 2019
by
段英荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify
parent
e79705ed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
topic.py
search/utils/topic.py
+9
-4
No files found.
search/utils/topic.py
View file @
42514adb
...
...
@@ -120,7 +120,7 @@ class TopicUtils(object):
return
{}
@classmethod
def
get_recommend_topic_ids
(
cls
,
user_id
,
tag_id
,
offset
,
size
,
single_size
,
query
=
None
,
query_type
=
TopicPageType
.
FIND_PAGE
,
def
get_recommend_topic_ids
(
cls
,
user_id
,
tag_id
,
offset
,
size
,
single_size
,
query
=
None
,
query_type
=
TopicPageType
.
HOME_RECOMMEND
,
filter_topic_id_list
=
[],
test_score
=
False
,
must_topic_id_list
=
[],
recommend_tag_list
=
[],
user_similar_score_list
=
[],
index_type
=
"topic"
,
routing
=
None
,
attention_tag_list
=
[],
linucb_user_id_list
=
[],
disable_collpase
=
False
):
"""
...
...
@@ -305,9 +305,14 @@ class TopicUtils(object):
query_function_score
[
"query"
][
"bool"
][
"must_not"
]
=
[
{
"term"
:
{
"is_operation_home_recommend"
:
True
}}
]
query_function_score
[
"query"
][
"bool"
][
"filter"
]
.
append
(
{
"term"
:
{
"content_level"
:
6
}}
)
if
query_type
==
TopicPageType
.
FIND_PAGE
:
query_function_score
[
"query"
][
"bool"
][
"filter"
]
.
append
(
{
"range"
:
{
"content_level"
:
{
"gte"
:
4
,
"lte"
:
6
}}}
)
else
:
query_function_score
[
"query"
][
"bool"
][
"filter"
]
.
append
(
{
"term"
:
{
"content_level"
:
6
}}
)
q
[
"query"
][
"function_score"
]
=
query_function_score
if
not
disable_collpase
:
q
[
"collapse"
]
=
{
...
...
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