diff --git a/app/mix/dao/elasticsearch.go b/app/mix/dao/elasticsearch.go index bc09c239..a1055426 100644 --- a/app/mix/dao/elasticsearch.go +++ b/app/mix/dao/elasticsearch.go @@ -51,7 +51,7 @@ func (es *ElasticSearch) getIndexStreamerAcct() string { func (es *ElasticSearch) CreateStreamerAcct(ctx *gin.Context, streameraccts []*dbstruct.EsStreamerAcct) error { bulk := es.clientMix.Bulk().Index(es.getIndexStreamerAcct()).Refresh("true") for _, streameracct := range streameraccts { - bulk.Add(elastic.NewBulkCreateRequest().Doc(streameracct)) + bulk.Add(elastic.NewBulkCreateRequest().Id(fmt.Sprint(streameracct.Mid)).Doc(streameracct)) } logger.Info("bulk: %v", bulk) rsp, err := bulk.Do(ctx)