Skip to content

Instantly share code, notes, and snippets.

@geetanjaligg
Last active August 29, 2015 14:10
Show Gist options
  • Save geetanjaligg/00cfb422de4f7cf4def3 to your computer and use it in GitHub Desktop.
Save geetanjaligg/00cfb422de4f7cf4def3 to your computer and use it in GitHub Desktop.
Read json file and index in ElasticSearch
import rawes #install rawes. pip install rawes
es = rawes.Elastic('localhost:9200')
#index each line
with open('sample.json','r') as f:
for line in f:
es.post('index_name/index_type',data=line)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment