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
8ca59f88
Commit
8ca59f88
authored
Apr 08, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change size
parent
55d23168
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
group.py
search/utils/group.py
+10
-7
pictorial.json
trans2es/mapping/pictorial.json
+0
-2
No files found.
search/utils/group.py
View file @
8ca59f88
...
...
@@ -68,7 +68,10 @@ class GroupUtils(object):
q
[
"_source"
]
=
{
"includes"
:
[
"id"
]
}
result_dict
=
ESPerform
.
get_search_results
(
es_cli_obj
,
"pictorial"
,
q
,
offset
,
size
)
MAX_LOAD
=
100
sizes
=
max
(
size
,
MAX_LOAD
)
result_dict
=
ESPerform
.
get_search_results
(
es_cli_obj
,
"pictorial"
,
q
,
offset
,
sizes
)
pictorial_ids_list
=
[]
if
len
(
result_dict
[
"hits"
])
>
0
:
...
...
@@ -97,7 +100,7 @@ class GroupUtils(object):
}
}
topic_ids_list
=
[]
result_dict
=
ESPerform
.
get_search_results
(
es_cli_obj
,
"topic"
,
q
,
offset
,
size
)
result_dict
=
ESPerform
.
get_search_results
(
es_cli_obj
,
"topic"
,
q
,
offset
,
size
s
)
if
len
(
result_dict
[
"hits"
])
>
0
:
topic_ids_list
=
[
item
[
"_source"
][
"id"
]
for
item
in
result_dict
[
"hits"
]]
...
...
@@ -105,7 +108,7 @@ class GroupUtils(object):
if
len
(
topic_ids_list
)
>
5
:
pictorial_del_ids_list
.
append
(
id
)
return
pictorial_del_ids_list
return
pictorial_del_ids_list
[
offset
:(
offset
+
size
)]
else
:
return
[]
...
...
@@ -136,10 +139,10 @@ class GroupUtils(object):
q
[
"_source"
]
=
{
"includes"
:
[
"attention_pictorial_id_list"
]
}
#
MAX_LOAD = 100
#
sizes = max(size, MAX_LOAD)
MAX_LOAD
=
100
sizes
=
max
(
size
,
MAX_LOAD
)
result_dict
=
ESPerform
.
get_search_results
(
es_cli_obj
,
"user"
,
q
,
offset
,
size
)
result_dict
=
ESPerform
.
get_search_results
(
es_cli_obj
,
"user"
,
q
,
offset
,
size
s
)
pictorial_ids_list
=
[]
if
len
(
result_dict
[
"hits"
])
>
0
:
pictorial_ids_list
=
result_dict
[
"hits"
][
0
][
"_source"
][
"attention_pictorial_id_list"
]
...
...
@@ -175,7 +178,7 @@ class GroupUtils(object):
if
len
(
topic_ids_list
)
>
5
:
pictorial_del_ids_list
.
append
(
id
)
return
pictorial_del_ids_list
return
pictorial_del_ids_list
[
offset
:(
offset
+
size
)]
else
:
return
[]
...
...
trans2es/mapping/pictorial.json
View file @
8ca59f88
...
...
@@ -16,6 +16,5 @@
"tag_id"
:{
"type"
:
"long"
},
"tag_name"
:{
"type"
:
"text"
,
"analyzer"
:
"gm_default_index"
,
"search_analyzer"
:
"gm_default_index"
},
"topic_id_list"
:{
"type"
:
"long"
}
}
}
\ No newline at end of file
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