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
33ff44e9
Commit
33ff44e9
authored
Mar 22, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
9d6513d9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
group.py
search/views/group.py
+11
-10
No files found.
search/views/group.py
View file @
33ff44e9
...
...
@@ -108,7 +108,7 @@ def pictorial_topic(topic_id=-1, offset=0, size=10):
"include"
:
[
"id"
,
"pictorial_id"
,
"tag_list"
]
}
result_dict
=
ESPerform
.
get_search_results
(
es_cli_obj
,
"topic"
,
q
,
offset
,
size
)
logging
.
info
(
"get result_dict:
%
s"
%
result_dict
)
logging
.
info
(
"get result_dict:
%
s"
%
result_dict
)
pict_pictorial_ids_list
=
[]
topic_tag_list
=
[]
pictorial_id_list
=
[]
...
...
@@ -135,13 +135,13 @@ def pictorial_topic(topic_id=-1, offset=0, size=10):
for
item
in
result_dict
[
"hits"
]:
pictorial_id
=
item
[
"_source"
][
"id"
]
pictorial_id_list
.
append
(
pictorial_id
)
logging
.
info
(
"get pictorial_id_list:
%
s"
%
pictorial_id_list
)
logging
.
info
(
"get topic_tag_list:
%
s"
%
topic_tag_list
)
logging
.
info
(
"get pictorial_id_list:
%
s"
%
pictorial_id_list
)
logging
.
info
(
"get topic_tag_list:
%
s"
%
topic_tag_list
)
if
len
(
pict_pictorial_ids_list
)
<
10
:
q
[
"query"
]
=
{
"bool"
:{
"must"
:{
"bool"
:
{
"must"
:
[
{
"term"
:
{
"is_online"
:
True
},
...
...
@@ -149,9 +149,11 @@ def pictorial_topic(topic_id=-1, offset=0, size=10):
"is_delete"
:
False
},
"terms"
:
{
"tag_id"
:
[
211302
,
195275
,
195246
,
317175
,
274332
,
96
,
345697
,
336486
,
473577
,
336051
,
847034
,
482012
]
#topic_tag_list
"tag_id"
:
[
211302
,
195275
,
195246
,
317175
,
274332
,
96
,
345697
,
336486
,
473577
,
336051
,
847034
,
482012
]
# topic_tag_list
}
}
}
]
}
}
...
...
@@ -164,8 +166,8 @@ def pictorial_topic(topic_id=-1, offset=0, size=10):
}
}
q
[
"form"
]
=
0
q
[
"size"
]
=
10
q
[
"form"
]
=
0
q
[
"size"
]
=
10
result_dict
=
ESPerform
.
get_search_results
(
es_cli_obj
,
"pictorial"
,
q
,
offset
,
size
)
if
len
(
result_dict
[
"hits"
])
>
0
:
...
...
@@ -173,7 +175,6 @@ def pictorial_topic(topic_id=-1, offset=0, size=10):
logging
.
info
(
"get result_dict tag:
%
s"
%
result_dict
)
return
{
"pictorial_ids_list"
:
pictorial_id_list
}
else
:
...
...
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