Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 1 | import itertools |
| 2 | import string |
| 3 | import json |
| 4 | from datetime import datetime |
| 5 | from elasticsearch import Elasticsearch |
| 6 | import elasticsearch |
| 7 | import elasticsearch.helpers |
| 8 | from elasticsearch.client import IndicesClient |
| 9 | import sys, os |
| 10 | |
| 11 | def readFileToJson(fileName): |
| 12 | print "read file ", fileName |
| 13 | fo=open(fileName) |
| 14 | try: |
| 15 | json_mapping=json.load(fo) |
| 16 | fo.close() |
| 17 | except ValueError: |
| 18 | print "error in reading file " , fileName |
| 19 | fo.close() |
| 20 | raise |
| 21 | return json_mapping |