# Sample Data bank does not work

**URL:** <https://discuss.elastic.co/t/sample-data-bank-does-not-work/71631>\
**Category:** Elasticsearch\
**Created:** [January 15, 2017, 4:22am UTC](https://discuss.elastic.co/t/sample-data-bank-does-not-work/71631 "2017-01-15T04:22:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lielar](https://avatars.discourse-cdn.com/v4/letter/l/a8b319/32.png) [@lielar](https://discuss.elastic.co/u/lielar)\
**Post date:** [January 15, 2017, 4:22am UTC](https://discuss.elastic.co/t/sample-data-bank-does-not-work/71631/1 "2017-01-15T04:22:48Z")

</div>

Hi

First time user of elasticsearch - I have attempted to download the sample data from [Sample Data](https://www.elastic.co/guide/en/kibana/current/tutorial-load-dataset.html), in particular, the bank sample data. The syntax to add the mapping for the bank data (which is missing) is as follows

```
{
 "mappings" : {
  "_default_" : {
   "properties" : {
"account_number" : {"type": "integer", "index" : "not_analyzed" },
"balance" : {"type": "integer", "index" : "not_analyzed" },
"firstname" : {"type": "string", "index" : "not_analyzed" },
"lastname" : {"type": "string", "index" : "not_analyzed" },
"age" : {"type": "integer", "index" : "not_analyzed" },
"gender" : {"type": "string", "index" : "not_analyzed" },
"address" : {"type": "string", "index" : "not_analyzed" },
"employer" : {"type": "string", "index" : "not_analyzed" },
"email" : {"type": "string", "index" : "not_analyzed" },
"city" : {"type": "string", "index" : "not_analyzed" },
"state" : {"type": "string", "index" : "not_analyzed" }
   }
  }
 }
}

```

However when I attempt to add in the sample data via postman at [localhost:9200/bank/\_bulk](http://localhost:9200/bank/_bulk)

I get the following error

```
{
  "error": {
    "root_cause": [
      {
        "type": "action_request_validation_exception",
        "reason": "Validation Failed: 1: type is missing;2: type is missing;3: type is missing;4: type is missing;5: type is missing;6: type is missing;7: type is missing;8: type is missing;9: type is missing;10: type is missing;11: type is missing;12: type is missing;13: type is missing;14: type is missing;15: 

```

Any ideas? Thanks

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 15, 2017, 5:54am UTC](https://discuss.elastic.co/t/sample-data-bank-does-not-work/71631/2 "2017-01-15T05:54:47Z")

</div>

Here is an example on how to define a mapping: [https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-put-mapping.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-put-mapping.html)

---

<div class="post-metadata">

**Author:** ![lielar](https://avatars.discourse-cdn.com/v4/letter/l/a8b319/32.png) [@lielar](https://discuss.elastic.co/u/lielar)\
**Post date:** [January 15, 2017, 8:07am UTC](https://discuss.elastic.co/t/sample-data-bank-does-not-work/71631/3 "2017-01-15T08:07:14Z")

</div>

Hi

Thanks for the reply and assistance.

I fixed up my index so it looks something like this  
{  
"properties" : {  
"account" : {  
"account\_number" : {"type": "integer", "index" : "not\_analyzed" },  
"balance" : {"type": "integer", "index" : "not\_analyzed" },  
"firstname" : {"type": "string", "index" : "not\_analyzed" },  
"lastname" : {"type": "string", "index" : "not\_analyzed" },  
"age" : {"type": "integer", "index" : "not\_analyzed" },  
"gender" : {"type": "string", "index" : "not\_analyzed" },  
"address" : {"type": "string", "index" : "not\_analyzed" },  
"employer" : {"type": "string", "index" : "not\_analyzed" },  
"email" : {"type": "string", "index" : "not\_analyzed" },  
"city" : {"type": "string", "index" : "not\_analyzed" },  
"state" : {"type": "string", "index" : "not\_analyzed" }  
}  
}  
}

I also fixed up the json file so it looks something like this

```
{"index":{"_index":"bank","_type":"line","_id":1}}
{"account_number":1,"balance":39225,"firstname":"Amber","lastname":"Duke","age":32,"gender":"M","address":"880 Holmes Lane","employer":"Pyrami","email":"amberduke@pyrami.com","city":"Brogan","state":"IL"}
{"index":{"_index":"bank","_type":"line","_id":6}}
{"account_number":6,"balance":5686,"firstname":"Hattie","lastname":"Bond","age":36,"gender":"M","address":"671 Bristol Street","employer":"Netagy","email":"hattiebond@netagy.com","city":"Dante","state":"TN"}

```

I am getting an error of  
"type": "json\_parse\_exception",  
"reason": "Unexpected character ('"' (code 34)): was expecting comma to separate Object entries\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@1528955b; line: 1, column: 52]"

Please point me in the right direction. I'll admit I had not read all the documentation. 🙂

---

<div class="post-metadata">

**Author:** ![lielar](https://avatars.discourse-cdn.com/v4/letter/l/a8b319/32.png) [@lielar](https://discuss.elastic.co/u/lielar)\
**Post date:** [January 15, 2017, 8:15am UTC](https://discuss.elastic.co/t/sample-data-bank-does-not-work/71631/4 "2017-01-15T08:15:55Z")

</div>

Found my error - should have posted to localhost:9200/bank/account/\_bulk?pretty

Thanks for your help. On my way 🙂

---

<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:** [February 12, 2017, 8:15am UTC](https://discuss.elastic.co/t/sample-data-bank-does-not-work/71631/5 "2017-02-12T08:15:54Z")

</div>

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