Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
crawler
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
backend
crawler
Commits
2b161638
Commit
2b161638
authored
4 years ago
by
litaolemo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
88bc5268
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
revise_data_from_es.py
write_data_into_es/revise_data_from_es.py
+10
-10
No files found.
write_data_into_es/revise_data_from_es.py
View file @
2b161638
...
...
@@ -23,10 +23,10 @@ es7 = e7.Elasticsearch(hosts="172.16.52.27", port=9200,http_auth=("elastic","gen
# es7 = e7.Elasticsearch(hosts="172.16.31.17", port=9000)
target_index
=
'gm-dbmw-
doctor
-read'
target_type
=
'
doctor
'
target_index
=
'gm-dbmw-
problem
-read'
target_type
=
'
problem
'
from_index
=
'gm-dbmw-
doctor
-read'
from_index
=
'gm-dbmw-
problem
-read'
from_type
=
'_doc'
...
...
@@ -60,13 +60,13 @@ for one_scan in write_into_scan:
count
=
count
+
1
line
=
one_scan
[
'_source'
]
doc_id
=
one_scan
[
'_id'
]
try
:
if
line
[
'facevideo_is_assistant'
]
==
1
:
line
[
'facevideo_is_assistant'
]
=
True
else
:
line
[
'facevideo_is_assistant'
]
=
False
except
:
pass
#
try:
#
if line['facevideo_is_assistant'] == 1:
#
line['facevideo_is_assistant'] = True
#
else:
#
line['facevideo_is_assistant'] = False
#
except:
#
pass
bulk_head
=
'{"index": {"_id":"
%
s"}}'
%
doc_id
data_str
=
json
.
dumps
(
line
,
ensure_ascii
=
False
)
...
...
This diff is collapsed.
Click to expand it.
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