func (es *Es) PutMappingJson(ctx context.Context, mapping string) error {
	var (
		res *elastic.PutMappingResponse
		err error
	)
	if res, err = es.client.PutMapping().Index(es.esIndex).IncludeTypeName(false).BodyString(mapping).Do(ctx); err != nil {
		return errors.Wrap(err, "call PutMappingJson() error")
	}
	if !res.Acknowledged {
		return errors.New("putmapping failed!!!")
	}
	return nil
}
// PutMappingJson updates mapping with json data
PutMappingJson updates mapping with json data
// PutMappingJson updates mapping with json data
func (es *Es) PutMappingJson(ctx context.Context, mapping string) error {
	var (
		res *elastic.PutMappingResponse
		err error
	)
	if res, err = es.client.PutMapping().Index(es.esIndex).IncludeTypeName(false).BodyString(mapping).Do(ctx); err != nil {
		return errors.Wrap(err, "call PutMappingJson() error")
	}
	if !res.Acknowledged {
		return errors.New("putmapping failed!!!")
	}
	return nil
}
func ( es * Es ) PutMappingJson ( ctx context . Context , mapping string ) error { var ( res * elastic . PutMappingResponse err error ) if res , err = es . client . PutMapping ( ) . Index ( es . esIndex ) . IncludeTypeName ( false ) . BodyString ( mapping ) . Do ( ctx ) ; err != nil { return errors . Wrap ( err , " " ) } if ! res . Acknowledged { return errors . New ( " " ) } return nil }
PutMappingJson updates mapping with json data
PutMappingJson updates mapping with json data