# Default Mapping Setup

**URL:** https://discuss.elastic.co/t/default-mapping-setup/28111
**Category:** Elasticsearch
**Created:** [August 26, 2015, 2:07pm UTC](https://discuss.elastic.co/t/default-mapping-setup/28111 "2015-08-26T14:07:23Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![JoeeGrigg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joeegrigg/32/4411_2.png) [@JoeeGrigg](https://discuss.elastic.co/u/JoeeGrigg)
#### Post date: [August 26, 2015, 2:07pm UTC](https://discuss.elastic.co/t/default-mapping-setup/28111/1 "2015-08-26T14:07:23Z")

</div>

I have been trying to set up default mappings for a brand new index and I keep getting errors.

This is what I am doing

```
PUT /documents
{
  mappings": {
    "_default_: {
      "title": {"type": "string"},
      "author": {"type": "string"},
      "description": {"type": "string"},
      "tags": {"type": "string"},
      "country": {"type": "string"},
      "version": {"type": "double"},
      "revisions": {"type": "string"},
      "createdAt": {"type": "date"},
      "updatedAt": {"type": "date"},
      "fileType": {"type": "string"},
      "urlToFile": {"type": "string"},
      "archived": {"type": "boolean"},
      "archivedDate": {"type": "date"},
      "archivedReason": {"type": "string"}
    }
  }
}

```

And then the error that I am getting is:

```
{"error":"ElasticsearchParseException[failed to parse source for create index]; nested: JsonParseException[Illegal unquoted character ((CTRL-CHAR, code 10)): has to be escaped using backslash to be included in name\n at [Source: [B@75dfe5d5; line: 3, column: 17]]; ","status":400}

```

Does anyone have any ideas?

---

<div class="post-metadata">

### Author: ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)
#### Post date: [August 26, 2015, 2:09pm UTC](https://discuss.elastic.co/t/default-mapping-setup/28111/2 "2015-08-26T14:09:24Z")

</div>

You are missing a `"` character after `_default`:

> [@JoeeGrigg](#):
>
> "_default_: {

---

<div class="post-metadata">

### Author: ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)
#### Post date: [August 26, 2015, 2:12pm UTC](https://discuss.elastic.co/t/default-mapping-setup/28111/3 "2015-08-26T14:12:08Z")

</div>

You are also missing a `"` before `mappings`:

> [@JoeeGrigg](#):
>
> mappings": {

---

<div class="post-metadata">

### Author: ![JoeeGrigg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joeegrigg/32/4411_2.png) [@JoeeGrigg](https://discuss.elastic.co/u/JoeeGrigg)
#### Post date: [August 26, 2015, 2:12pm UTC](https://discuss.elastic.co/t/default-mapping-setup/28111/4 "2015-08-26T14:12:15Z")

</div>

Ah yeah that was silly.

However I have fixed that and still not having any luck.

I am still getting the same error 😕

---

<div class="post-metadata">

### Author: ![JoeeGrigg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joeegrigg/32/4411_2.png) [@JoeeGrigg](https://discuss.elastic.co/u/JoeeGrigg)
#### Post date: [August 26, 2015, 2:15pm UTC](https://discuss.elastic.co/t/default-mapping-setup/28111/5 "2015-08-26T14:15:04Z")

</div>

Never mind. But I do have a different error now 😕

```
{"error":"MapperParsingException[mapping [_default_]]; nested: MapperParsingException[Root type mapping not empty after parsing! Remaining fields: [archivedDate : {type=date}] [country : {type=string}] [urlToFile : {type=string}] [author : {type=string}] [description : {type=string}] [title : {type=string}] [version : {type=double}] [tags : {type=string}] [createdAt : {type=date}] [archived : {type=boolean}] [revisions : {type=string}] [fileType : {type=string}] [archivedReason : {type=string}] [updatedAt : {type=date}]]; ","status":400} 

```

Any ideas on this one? @colings86

---

<div class="post-metadata">

### Author: ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)
#### Post date: [August 26, 2015, 2:17pm UTC](https://discuss.elastic.co/t/default-mapping-setup/28111/6 "2015-08-26T14:17:44Z")

</div>

You need to have a `"properties":{}` object under `_default_` and put your fields in there. see [https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-core-types.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-core-types.html) for more information on setting mappings

---

<div class="post-metadata">

### Author: ![JoeeGrigg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joeegrigg/32/4411_2.png) [@JoeeGrigg](https://discuss.elastic.co/u/JoeeGrigg)
#### Post date: [August 26, 2015, 2:21pm UTC](https://discuss.elastic.co/t/default-mapping-setup/28111/7 "2015-08-26T14:21:09Z")

</div>

Ah that has worked.

Thank you 😄

---

<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: [July 5, 2017, 11:53pm UTC](https://discuss.elastic.co/t/default-mapping-setup/28111/8 "2017-07-05T23:53:44Z")

</div>


