2

I have a JSON array which contains a list of data that needs to be pushed to an ElasticSearch instance. Something like

[ {"Message": "2aTeFCKTYWwfrF"}, {"Message": "2aTeFCKTYWwfrD"}, {"Message": "2aTeFCKTYWwfrW"}.......{"Message": "2aTeFCKTYWwfrG"}]

Now to insert a simple JSON data (like only the element at the first index of this array) from Python into Elasticsearch, here is what I have

url = 'http://localhost:9200/hello/world'
payload = {"Message": "2aTeFCKTYWwfrF"}
response = requests.post(url, json=payload, headers={})

Now if I wanted to insert all the data from the array to the same endpoint using the Bulk API, how would I do it? I don't seem to understand the docs here one bit https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html

tsaebeht
  • 1,570
  • 5
  • 18
  • 32
  • Possible duplicate of [How to use Bulk API to store the keywords in ES by using Python](https://stackoverflow.com/questions/20288770/how-to-use-bulk-api-to-store-the-keywords-in-es-by-using-python) – Akhil Mathew Oct 15 '17 at 17:52

0 Answers0