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
ec47411b
Commit
ec47411b
authored
Jan 11, 2019
by
段英荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add batch_recommend_user
parent
1e0e4582
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
user.py
search/utils/user.py
+4
-3
No files found.
search/utils/user.py
View file @
ec47411b
...
...
@@ -261,9 +261,10 @@ class UserUtils(object):
query_body
=
""
for
query_item
in
batch_query_list
:
query_body
+=
"{}
\n
{}
\n
"
.
format
(
json
.
dumps
(
search_header_dict
),
json
.
dumps
(
query_item
))
result_dict
=
ESPerform
.
get_search_results
(
ESPerform
.
get_cli
(),
sub_index_name
=
"user"
,
query_body
=
query_body
,
batch_search
=
True
)
ret_dict
=
dict
()
user_index
=
0
for
res_item
in
result_dict
[
"responses"
]:
recommend_user_list
=
list
()
...
...
@@ -271,10 +272,10 @@ class UserUtils(object):
recommend_user_list
.
append
(
item
[
"_source"
][
"user_id"
])
logging
.
info
(
"duan add,attention_user_id_list:
%
s,user_index:
%
d"
%
(
str
(
attention_user_id_list
),
user_index
))
re
sul
t_dict
[
attention_user_id_list
[
user_index
]]
=
recommend_user_list
ret_dict
[
attention_user_id_list
[
user_index
]]
=
recommend_user_list
user_index
+=
1
return
re
sul
t_dict
return
ret_dict
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
return
dict
()
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