I tried to use the following code to create and load data into an index using python:
from datetime import datetime
from elasticsearch import Elasticsearch
from elasticsearch import helpers
es = Elasticsearch()
actions = [
{
"_index": "tickets-index",
"_type": "tickets",
"_id": j,
"_source": {
"any":"data" + str(j),
"timestamp": datetime.now()}
}
for j in range(0, 10)
]
helpers.bulk(es, actions)
On executing the code, it shows:
elasticsearch.exceptions.TransportError: TransportError(406, u'Content-Type header [] is not supported')
I guess this code was previously written by someone on this forum as a solution, but it did not work for me. Please let me know on why do we get this issue and how can i get this solved.
Thanks in advance.