# Custom type fields example doesn't work for me

**URL:** <https://discuss.elastic.co/t/custom-type-fields-example-doesnt-work-for-me/147435>\
**Category:** Elasticsearch\
**Created:** [September 5, 2018, 3:44pm UTC](https://discuss.elastic.co/t/custom-type-fields-example-doesnt-work-for-me/147435 "2018-09-05T15:44:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![trex](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/trex/32/34230_2.png) [@trex](https://discuss.elastic.co/u/trex)\
**Post date:** [September 5, 2018, 3:44pm UTC](https://discuss.elastic.co/t/custom-type-fields-example-doesnt-work-for-me/147435/1 "2018-09-05T15:44:19Z")

</div>

_Elasticsearch 6.2.4_

I execute the following in the Dev Tools:

```auto
    PUT twitter
    {
      "mappings": {
        "user": {
          "properties": {
            "name": { "type": "text" },
            "user_name": { "type": "keyword" },
            "email": { "type": "keyword" }
          }
        },
        "tweet": {
          "properties": {
            "content": { "type": "text" },
            "user_name": { "type": "keyword" },
            "tweeted_at": { "type": "date" }
          }
        }
      }
    } 

```

And get error

```auto
    {
      "error": {
        "root_cause": [
          {
            "type": "illegal_argument_exception",
            "reason": "Rejecting mapping update to [twitter] as the final mapping would have more than 1 type: [tweet, user]"
          }
        ],
        "type": "illegal_argument_exception",
        "reason": "Rejecting mapping update to [twitter] as the final mapping would have more than 1 type: [tweet, user]"
      },
      "status": 400
    }

```

I got this example from [here](https://www.elastic.co/blog/removal-of-mapping-types-elasticsearch). How can I use the custom type fields?

---

<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 3, 2018, 3:44pm UTC](https://discuss.elastic.co/t/custom-type-fields-example-doesnt-work-for-me/147435/2 "2018-10-03T15:44:22Z")

</div>

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