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
钟尚武
physical
Commits
f756ee0f
Commit
f756ee0f
authored
Aug 22, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
eb92d6a1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
11 deletions
+0
-11
group.py
search/views/group.py
+0
-11
No files found.
search/views/group.py
View file @
f756ee0f
...
...
@@ -148,9 +148,6 @@ def pictorial_topic(topic_id=-1, offset=0, size=10):
for
item
in
result_dict
[
"hits"
]:
pict_pictorial_ids_list
=
item
[
"_source"
][
"pictorial_id"
]
topic_tag_list
=
item
[
"_source"
][
"tag_list"
]
logging
.
info
(
"get pict_pictorial_ids_list:
%
s"
%
pict_pictorial_ids_list
)
logging
.
info
(
"get topic_tag_list:
%
s"
%
topic_tag_list
)
##先拿到当前帖子对应的标签的分类ID
tag_type_ids
=
CommunityCategoryTagRelation
.
objects
.
filter
(
tag_id__in
=
topic_tag_list
,
is_online
=
True
,
is_deleted
=
False
)
.
values_list
(
...
...
@@ -196,11 +193,9 @@ def pictorial_topic(topic_id=-1, offset=0, size=10):
pictorial_id_list
.
append
(
pictorial_id
)
functions_list
=
[]
logging
.
info
(
"get pictorial_id_list:
%
s"
%
pictorial_id_list
)
all_tag
=
[]
all_tag
.
extend
(
topic_tag_list
)
all_tag
.
extend
(
tag_type_ids
)
logging
.
info
(
"get all_tag:
%
s"
%
all_tag
)
# 如果不够10个去拿所属标签的榜单和所属分类的标签的榜单
if
len
(
pictorial_id_list
)
<
10
and
len
(
all_tag
)
>
0
:
num
=
10
-
len
(
pictorial_id_list
)
...
...
@@ -267,22 +262,16 @@ def pictorial_topic(topic_id=-1, offset=0, size=10):
]
result_dict
=
ESPerform
.
get_search_results
(
es_cli_obj
,
"pictorial"
,
q
,
0
,
10
)
logging
.
info
(
"get result_dict:
%
s"
%
result_dict
)
if
len
(
result_dict
[
"hits"
])
>
0
:
for
item
in
result_dict
[
"hits"
]:
id
=
item
[
"_source"
][
"id"
]
if
id
not
in
pictorial_id_list
:
pictorial_id_list
.
append
(
id
)
#
logging
.
info
(
"get pictorial_id_list:
%
s"
%
pictorial_id_list
)
pictorial_list
=
pictorial_id_list
if
len
(
pictorial_id_list
)
<
10
else
pictorial_id_list
[:
10
]
return
{
"pictorial_ids_list"
:
pictorial_list
}
else
:
return
{
"pictorial_ids_list"
:
pictorial_id_list
}
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
return
{
"pictorial_ids_list"
:
[]}
...
...
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