By Robin at 20240524
This commit is contained in:
parent
0d6a991101
commit
e141dc412c
|
@ -51,7 +51,7 @@ func (es *ElasticSearch) getIndexStreamerAcct() string {
|
||||||
func (es *ElasticSearch) CreateStreamerAcct(ctx *gin.Context, streameraccts []*dbstruct.EsStreamerAcct) error {
|
func (es *ElasticSearch) CreateStreamerAcct(ctx *gin.Context, streameraccts []*dbstruct.EsStreamerAcct) error {
|
||||||
bulk := es.clientMix.Bulk().Index(es.getIndexStreamerAcct()).Refresh("true")
|
bulk := es.clientMix.Bulk().Index(es.getIndexStreamerAcct()).Refresh("true")
|
||||||
for _, streameracct := range streameraccts {
|
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)
|
logger.Info("bulk: %v", bulk)
|
||||||
rsp, err := bulk.Do(ctx)
|
rsp, err := bulk.Do(ctx)
|
||||||
|
|
Loading…
Reference in New Issue