Elasticsearch Define Dynamic Mapping

Hi,

I'm using Elasticsearch 2.3.4 & Elasticsearch.Net (Low-level client) SDK for indexing JSON documents which are dynamic in nature.

I want to create mapping for my JSON structure before indexing documents in order to avoid field type getting detected (numeric_detection & date_detection = True) wrongly while inserting the first document.

How to PUT below mapping (JSON) through Elasticsearch.Net Or NEST SDK API?!
PUT my_index
{
"mappings": {
"user": {
"_all": { "enabled": false },
"properties": {
"title": { "type": "string" },
"name": { "type": "string" },
"age": { "type": "integer" }
}
},
"blogpost": {
"properties": {
"title": { "type": "string" },
"body": { "type": "string" },
"user_id": {
"type": "string",
"index": "not_analyzed"
},
"created": {
"type": "date",
"format": "strict_date_optional_time||epoch_millis"
}
}
}
}
}

Regards,
Sreeram

please provide some clarifications.

This question looks like How to define mapping in runtime, so I'll close it in favour of the other post.