Put a mapping using java api not working


can you quickly spot any errors in my code? it fails with root type not

XContentBuilder mapping = null;
    try {
        mapping = jsonBuilder()
                .field("type", "chat")
    } catch (IOException e) {

    PutMappingResponse putMappingResponse = client.admin().indices()

chat=parent document
message=child document

error = Root type mapping not empty after parsing! Remaining fields:
[message : {_parent={type=chat}}]

You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/fae56ba3-6bac-418d-8075-eafba49f5a28%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.