Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
meta_base_code
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
宋柯
meta_base_code
Commits
cc3dc3ab
Commit
cc3dc3ab
authored
Sep 10, 2020
by
litaolemo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
187154b5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
135 deletions
+16
-135
portary_div_exposure.py
utils/portary_div_exposure.py
+16
-135
No files found.
utils/portary_div_exposure.py
View file @
cc3dc3ab
...
@@ -57,7 +57,7 @@ def user_portrait_scan_info():
...
@@ -57,7 +57,7 @@ def user_portrait_scan_info():
# user_portrait_get_empty_candidates(device_id)
# user_portrait_get_empty_candidates(device_id)
try
:
try
:
res_dic
=
get_user_portrait_tag3_from_redis
(
device_id
)
res_dic
=
get_user_portrait_tag3_from_redis
(
device_id
)
print
(
res_dic
)
#
print(res_dic)
for
data_type
in
res_dic
:
for
data_type
in
res_dic
:
for
tag
in
res_dic
[
data_type
]:
for
tag
in
res_dic
[
data_type
]:
if
return_dict
.
get
(
tag
):
if
return_dict
.
get
(
tag
):
...
@@ -161,139 +161,14 @@ def get_device_num_from_es(word):
...
@@ -161,139 +161,14 @@ def get_device_num_from_es(word):
doc_type
=
'doc'
,
doc_type
=
'doc'
,
timeout
=
'10s'
,
timeout
=
'10s'
,
size
=
0
,
size
=
0
,
body
=
{
body
=
{
"aggs"
:
{
"query"
:
{
"NAME"
:
{
"bool"
:
{
"nested"
:
{
"path"
:
"projects"
},
"aggs"
:
{
"should"
:
[
"NAME1"
:
{
{
"terms"
:
{
"field"
:
"projects.name"
,
"size"
:
10000
}
"nested"
:
{
"path"
:
"first_demands"
,
"query"
:
{
"bool"
:
{
"must"
:
[
{
"terms"
:
{
"first_demands.name"
:
[
word
]
}
}
]
}
}
}
},
{
"nested"
:
{
"path"
:
"second_demands"
,
"query"
:
{
"bool"
:
{
"must"
:
[
{
"terms"
:
{
"second_demands.name"
:
[
word
]
}
}
]
}
}
}
},
{
"nested"
:
{
"path"
:
"first_solutions"
,
"query"
:
{
"bool"
:
{
"must"
:
[
{
"terms"
:
{
"first_solutions.name"
:
[
word
]
}
}
]
}
}
}
},
{
"nested"
:
{
"path"
:
"second_solutions"
,
"query"
:
{
"bool"
:
{
"must"
:
[
{
"terms"
:
{
"second_solutions.name"
:
[
word
]
}
}
]
}
}
}
},
{
"nested"
:
{
"path"
:
"first_positions"
,
"query"
:
{
"bool"
:
{
"must"
:
[
{
"terms"
:
{
"first_positions.name"
:
[
word
]
}
}
]
}
}
}
},
{
"nested"
:
{
"path"
:
"second_positions"
,
"query"
:
{
"bool"
:
{
"must"
:
[
{
"terms"
:
{
"second_positions.name"
:
[
word
]
}
}
]
}
}
}
},
{
"nested"
:
{
"path"
:
"projects"
,
"query"
:
{
"bool"
:
{
"must"
:
[
{
"terms"
:
{
"projects.name"
:
[
word
]
}
}
]
}
}
}
}
}
}
],
"minimum_should_match"
:
1
}
}
}
}
}
}
...
@@ -315,6 +190,12 @@ def get_es_article_num(tag_dict):
...
@@ -315,6 +190,12 @@ def get_es_article_num(tag_dict):
}
}
for
tag_type
in
tag_dict
:
for
tag_type
in
tag_dict
:
for
tag_name
in
tag_dict
[
tag_type
]:
for
tag_name
in
tag_dict
[
tag_type
]:
if
tag_type
==
"projects"
:
temp_name
=
"tags_v3"
elif
tag_type
==
"first_positions"
:
temp_name
=
"positions"
else
:
temp_name
=
tag_name
body
=
{
body
=
{
"query"
:
{
"query"
:
{
"bool"
:
{
"bool"
:
{
...
@@ -340,7 +221,7 @@ def get_es_article_num(tag_dict):
...
@@ -340,7 +221,7 @@ def get_es_article_num(tag_dict):
}
}
}
}
}
}
body
[
"query"
][
"bool"
][
"must"
]
.
append
({
"term"
:
{
t
ag_typ
e
:
tag_name
}})
body
[
"query"
][
"bool"
][
"must"
]
.
append
({
"term"
:
{
t
emp_nam
e
:
tag_name
}})
try
:
try
:
results
=
es
.
search
(
results
=
es
.
search
(
index
=
'gm-dbmw-answer-read'
,
index
=
'gm-dbmw-answer-read'
,
...
@@ -365,7 +246,7 @@ def get_es_article_num(tag_dict):
...
@@ -365,7 +246,7 @@ def get_es_article_num(tag_dict):
}
}
}
}
}
}
body
[
"query"
][
"bool"
][
"must"
]
.
append
({
"term"
:
{
t
ag_typ
e
:
tag_name
}})
body
[
"query"
][
"bool"
][
"must"
]
.
append
({
"term"
:
{
t
emp_nam
e
:
tag_name
}})
# tractate
# tractate
try
:
try
:
results
=
es
.
search
(
results
=
es
.
search
(
...
@@ -409,7 +290,7 @@ def get_es_article_num(tag_dict):
...
@@ -409,7 +290,7 @@ def get_es_article_num(tag_dict):
}
}
},
},
}
}
body
[
"query"
][
"bool"
][
"must"
]
.
append
({
"term"
:
{
t
ag_typ
e
:
tag_name
}})
body
[
"query"
][
"bool"
][
"must"
]
.
append
({
"term"
:
{
t
emp_nam
e
:
tag_name
}})
###diary 日记
###diary 日记
try
:
try
:
results
=
es
.
search
(
results
=
es
.
search
(
...
...
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