I'm trying to import data located in a json file into an elasticsearch index using the curl command.
The index is being created using kibana as follow
PUT employees
{
"mappings" : {
"properties":{
"fields": {
"properties": {
"id": {"type": "text"},
"nom": {"type": "text"},
"prenom": {"type": "text"},
"sexe": {"type": "text"},
"socials": {
"properties": {
"name": {"type": "text"},
"url": {"type": "text"}
}
},
}
}
}
}
}
I'm running the follwing command to import the data
curl -XPUT -H "Content-Type: application/json" localhost:9200/_bulk --data-binary @users.json
the users.json file contains the data represented as follow
{"index": {"_index": "users", "_type": "user", "_id": 1}}
{"fields": {"id": "5fe60ae52b40e53609c803ec","nom": "Jessica","prenom": "Herrera","aboutMe": "anim","socials": [{"name": "faacebook","url": "https://www.facebook.com/profile?id=5445546"},{"name": "linkedin","url": "https://www.linkedin.com/profile?id=5445546"}],"affiliations": [{"organisation": "ANARCO","equipe": "developpement","pays": "Russian Federation","dateD": "2013-06-03T00:00:00Z" ,"dateF": "2013-06-03T00:00:00Z" }]}}
Here is the error I get
"type":"illegal_argument_exception","reason":"Rejecting mapping update to [users] as the final mapping would have more than 1 type
I've read many resources but still not able to understand what I'm missing.