Error while importing json file

I created one index and then tried to import a json file. But it displays a parsing error.
Elasticsearch 7.2.0
POST accounts/acc
{
"mappings": {
"default": {
"properties": {
"account_number": {
"type": "integer"
},
"balance": {
"type": "integer",
"index": "not_analyzed"
},
"firstname": {
"type": "string"
},
"age": {
"type": "integer"
}
}
}
}
}

PUT accounts/acc/_bulk --data-binary @accounts.json

The json file is : https://github.com/elastic/elasticsearch/blob/master/docs/src/test/resources/accounts.json

error log is:
{
"error": {
"root_cause": [
{
"type": "json_parse_exception",
"reason": "Unrecognized token 'PUT': was expecting ('true', 'false' or 'null')\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@8f68b4c; line: 1, column: 5]"
}
],
"type": "json_parse_exception",
"reason": "Unrecognized token 'PUT': was expecting ('true', 'false' or 'null')\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@8f68b4c; line: 1, column: 5]"
},
"status": 500
}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.