import json
from elasticsearch import Elasticsearch
es = Elasticsearch("localhost:9200")
f = open('../result/template.json', 'r')
json_dict = json.load(f)
# print(str(len(json_dict)))
print('{}'.format(json_dict['1']))
for item in range(len(json_dict)):
databody="{}".format(json_dict[str(item)])
es.index(
index = "proto",
doc_type = "test",
id=item,
body = databody
)