I use NEST functionality to build mapping for my index. I do it in the following way:
TypeMappingDescriptor<object> typeMappingDescriptor= new TypeMappingDescriptor<object>();
typeMappingDescriptor.Map<object>(ms => ms
.Properties(ps => ps
.Text(txt => txt .Name("text").IncludeInAll())
.Number(n=> n.Name("number").Type(NumberType.Byte).IncludeInAll())
)
.DynamicTemplates(x => x
.DynamicTemplate("customanalyzer_for_strings", y => y
.PathMatch("path")
.MatchMappingType("string")
.Mapping(t => t
.Text(r => r
.Fields(fg => fg
.Keyword(k=> k.Name("raw"))))))));
And I want convert typeMappingDescriptor to string representation or Json like this:
"mappings": {
"filesetdata": {
"properties": {
......
}
}
}
How can I do it?