Skip to content

Commit

Permalink
Merge pull request #33 from newpanjing/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
newpanjing committed Jun 15, 2022
2 parents 6ea2d7e + 6c6c276 commit 59d4e00
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion web/controller/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func AddIndex(c *gin.Context) {

// BatchAddIndex 批量添加索引
func BatchAddIndex(c *gin.Context) {
documents := make([]model.IndexDoc, 0)
documents := make([]*model.IndexDoc, 0)
if err := c.BindJSON(&documents); err != nil {
ResponseErrorWithMsg(c, err.Error())
return
Expand Down
4 changes: 2 additions & 2 deletions web/service/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ func (i *Index) AddIndex(dbName string, request *model.IndexDoc) {
}

// BatchAddIndex 批次添加索引
func (i *Index) BatchAddIndex(dbName string, documents []model.IndexDoc) {
func (i *Index) BatchAddIndex(dbName string, documents []*model.IndexDoc) {
db := i.Container.GetDataBase(dbName)
for _, doc := range documents {
go db.IndexDocument(&doc)
go db.IndexDocument(doc)
}
}

Expand Down

0 comments on commit 59d4e00

Please sign in to comment.