By Robin at 20240524

This commit is contained in:
Leufolium 2024-05-24 23:27:05 +08:00
parent 0d6a991101
commit e141dc412c
1 changed files with 1 additions and 1 deletions

View File

@ -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)