如何将数据从Elastigo到Olivere插入数据/更改数据到Elastic Search

时间:2018-11-21 06:59:46

标签: elasticsearch go insert

有人知道如何使用Olivere将数据插入到Elasticsearch中吗?我有一些代码在用于向弹性搜索中插入数据时使用了Elastigo,

indexing := "client_" + client_id
indextype := "datalist"
id__ := fmt.Sprintf("%s%x", dt.Article_id, md5.Sum([]byte(category_id)))

// fmt.Printf("print sean : ", indexing) //sean
errRes := indexer.Index(indexing, indextype, id__, "", "", nil, NewClien(id__, stringToInt(dt.Article_id), category_id, convertedDateString, stringToInt(dt.Media_id), stringToInt(mentiontimes), sentiment_o, exposure, roundD(advalue_fc), stringToInt(dt.Circulation), roundD(advalue_bw), data_input_date, user, pc_name))
if errRes != nil {
    fmt.Println("Error result for indexer.Index : ", errRes)
}
if errRes == nil {
    fmt.Println("Successfully pass the indexer.Index")
}

如何将代码更改为Olivere,尤其是代码indexer.Index()?

谢谢

0 个答案:

没有答案