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
db0591f2
Commit
db0591f2
authored
Dec 03, 2018
by
段英荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify
parent
7641a9e5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
7 deletions
+15
-7
topic.py
search/utils/topic.py
+10
-6
topic.py
search/views/topic.py
+0
-0
topic_transfer.py
trans2es/utils/topic_transfer.py
+5
-1
No files found.
search/utils/topic.py
View file @
db0591f2
...
...
@@ -88,7 +88,7 @@ class TopicUtils(object):
return
[]
@classmethod
def
get_recommend_topic_ids
(
cls
,
user_id
,
offset
,
size
,
is_first_time
,
query
=
None
):
def
get_recommend_topic_ids
(
cls
,
user_id
,
offset
,
size
,
query
=
None
):
"""
:需增加打散逻辑
:remark:获取首页推荐帖子列表
...
...
@@ -244,17 +244,21 @@ class TopicUtils(object):
q
[
"query"
]
=
dict
()
functions_list
=
[
{
"filter"
:
{
"term"
:
{
"group_id"
:
topic_group_id
}},
"weight"
:
1
,
},
{
"filter"
:
{
"term"
:
{
"user_id"
:
topic_user_id
}},
"weight"
:
1000
}
]
if
isinstance
(
topic_group_id
,
int
)
and
topic_group_id
>
0
:
functions_list
.
append
(
{
"filter"
:
{
"term"
:
{
"group_id"
:
topic_group_id
}},
"weight"
:
1
,
}
)
query_tag_term_list
=
cls
.
___get_should_term_list
(
topic_tag_list
)
query_function_score
=
{
"query"
:{
...
...
search/views/topic.py
View file @
db0591f2
This diff is collapsed.
Click to expand it.
trans2es/utils/topic_transfer.py
View file @
db0591f2
...
...
@@ -24,7 +24,11 @@ class TopicTransfer(object):
res
[
"content"
]
=
instance
.
content
res
[
"content_level"
]
=
instance
.
content_level
res
[
"user_id"
]
=
instance
.
user_id
res
[
"group_id"
]
=
instance
.
group_id
if
instance
.
group
:
res
[
"group_id"
]
=
instance
.
group
.
id
else
:
res
[
"group_id"
]
=
-
1
res
[
"share_num"
]
=
instance
.
share_num
res
[
"pick_id_list"
]
=
instance
.
get_pick_id_info
()
...
...
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