Custom type fields example doesn't work for me

Elasticsearch 6.2.4

I execute the following in the Dev Tools:

    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

    {
      "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. How can I use the custom type fields?

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