# Getting Error While trying to Upload Shakespeare.json

**URL:** <https://discuss.elastic.co/t/getting-error-while-trying-to-upload-shakespeare-json/150915>\
**Category:** Elasticsearch\
**Created:** [October 3, 2018, 3:34pm UTC](https://discuss.elastic.co/t/getting-error-while-trying-to-upload-shakespeare-json/150915 "2018-10-03T15:34:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shreyhere8](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@shreyhere8](https://discuss.elastic.co/u/shreyhere8)\
**Post date:** [October 3, 2018, 3:34pm UTC](https://discuss.elastic.co/t/getting-error-while-trying-to-upload-shakespeare-json/150915/1 "2018-10-03T15:34:43Z")

</div>

I am trying to upload shakespeare.json using  
curl -XPOST -H "Content-Type:application/json" "[http://localhost:9200/shakespeare/\_bulk?pretty](http://localhost:9200/shakespeare/_bulk?pretty)" --data-binary @shakespeare.json

But i am getting the error as  
{  
"error" : {  
"root\_cause" : [  
{  
"type" : "action\_request\_validation\_exception",  
"reason" : "Validation Failed: 1: type is missing;2: type is missing;"  
}  
],  
"type" : "action\_request\_validation\_exception",  
"reason" : "Validation Failed: 1: type is missing;2: type is missing;"  
},  
"status" : 400  
}

I have downloaded the file which looks like:  
{"index":{"\_index":"shakespeare","\_id":0}}  
{"type":"act","line\_id":1,"play\_name":"Henry IV", "speech\_number":"","line\_number":"","speaker":"","text\_entry":"ACT I"}  
{"index":{"\_index":"shakespeare","\_id":1}}  
{"type":"scene","line\_id":2,"play\_name":"Henry IV","speech\_number":"","line\_number":"","speaker":"","text\_entry":"SCENE I. London. The palace."}  
{"index":{"\_index":"shakespeare","\_id":2}}  
{"type":"line","line\_id":3,"play\_name":"Henry IV","speech\_number":"","line\_number":"","speaker":"","text\_entry":"Enter KING HENRY, LORD JOHN OF LANCASTER, the EARL of WESTMORELAND, SIR WALTER BLUNT, and others"}  
{"index":{"\_index":"shakespeare","\_id":3}}  
{"type":"line","line\_id":4,"play\_name":"Henry IV","speech\_number":1,"line\_number":"1.1.1","speaker":"KING HENRY IV","text\_entry":"So shaken as we are, so wan with care,"}

I have added Index as  
PUT /shakespeare  
{  
"mappings": {  
"doc": {  
"properties": {  
"speaker": {"type": "keyword"},  
"play\_name": {"type": "keyword"},  
"line\_id": {"type": "integer"},  
"speech\_number": {"type": "integer"}  
}  
}  
}  
}

Can anyone suggest where i am going wrong

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 31, 2018, 3:34pm UTC](https://discuss.elastic.co/t/getting-error-while-trying-to-upload-shakespeare-json/150915/2 "2018-10-31T15:34:56Z")

</div>

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