func NewMapping(mp MappingPayload) string {
	var (
		mapping    *gabs.Container
		properties *gabs.Container
	)

	mapping = gabs.New()
	mapping.SetP("60s", "settings.refresh_interval")
	mapping.SetP("1", "settings.number_of_replicas")
	mapping.SetP("15", "settings.number_of_shards")

	properties = gabs.New()
	for _, f := range mp.Fields {
		properties.Set(f.Type, f.Name, "type")
	}

	esType := mp.Type
	if stringutils.IsEmpty(esType) {
		esType = "_doc"
	}
	mapping.Set(properties, "mappings", esType, "properties")

	return mapping.String()
}
// NewMapping return es mapping json string from mp
NewMapping return es mapping json string from mp
// NewMapping return es mapping json string from mp
func NewMapping(mp MappingPayload) string {
	var (
		mapping    *gabs.Container
		properties *gabs.Container
	)
	mapping = gabs.New()
	mapping.SetP("60s", "settings.refresh_interval")
	mapping.SetP("1", "settings.number_of_replicas")
	mapping.SetP("15", "settings.number_of_shards")
	properties = gabs.New()
	for _, f := range mp.Fields {
		properties.Set(f.Type, f.Name, "type")
	}
	esType := mp.Type
	if stringutils.IsEmpty(esType) {
		esType = "_doc"
	}
	mapping.Set(properties, "mappings", esType, "properties")
	return mapping.String()
}
func NewMapping ( mp MappingPayload ) string { var ( mapping * gabs . Container properties * gabs . Container ) mapping = gabs . New ( ) mapping . SetP ( " " , " " ) mapping . SetP ( " " , " " ) mapping . SetP ( " " , " " ) properties = gabs . New ( ) for _ , f := range mp . Fields { properties . Set ( f . Type , f . Name , " " ) } esType := mp . Type if stringutils . IsEmpty ( esType ) { esType = " " } mapping . Set ( properties , " " , esType , " " ) return mapping . String ( ) }
NewMapping return es mapping json string from mp
NewMapping return es mapping json string from mp