Commit 847f128c authored by litaolemo's avatar litaolemo

update

parent e168da4b
...@@ -182,10 +182,10 @@ def bulk_write_into_es(dict_Lst, ...@@ -182,10 +182,10 @@ def bulk_write_into_es(dict_Lst,
write_counter += 1 write_counter += 1
if construct_id and platform is not None: if construct_id and platform is not None:
doc_id = construct_id_for_url_register(platform, line['url']) doc_id = construct_id_for_url_register(platform, line['url'])
action_str = ('{ "index" : { "_index" : "%s", "_type" : "%s", "_id" : "%s" } }' action_str = ('{ "index" : { "_index" : "%s", "_id" : "%s" } }'
% (index, doc_id)) % (index, doc_id))
else: else:
action_str = ('{ "index" : { "_index" : "%s", "_type" : "%s" } }' action_str = ('{ "index" : { "_index" : "%s" }'
% (index)) % (index))
data_str = json.dumps(line, ensure_ascii=False) data_str = json.dumps(line, ensure_ascii=False)
line_body = action_str + '\n' + data_str + '\n' line_body = action_str + '\n' + data_str + '\n'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment