diff --git a/storage/storageDBs/storage2Es.go b/storage/storageDBs/storage2Es.go index f0b150e..fb18f91 100644 --- a/storage/storageDBs/storage2Es.go +++ b/storage/storageDBs/storage2Es.go @@ -69,8 +69,7 @@ func (the *Storage2Es) SaveRaw(dataList []common_models.EsRaw) { `, the.rawIndex, _id, source) body.WriteString(s) } - //the.esHelper.BulkWrite(the.rawIndex, body.String()) - newEsHelper().BulkWrite(the.rawIndex, body.String()) + the.esHelper.BulkWrite(the.rawIndex, body.String()) } func (the *Storage2Es) SaveTheme(dataList []common_models.EsTheme) { @@ -90,8 +89,7 @@ func (the *Storage2Es) SaveTheme(dataList []common_models.EsTheme) { `, the.themeIndex, _id, source) body.WriteString(s) } - //the.esHelper.BulkWrite(the.themeIndex, body.String()) - newEsHelper().BulkWrite(the.themeIndex, body.String()) + the.esHelper.BulkWrite(the.themeIndex, body.String()) } func (the *Storage2Es) SaveVib(dataList []common_models.EsVbRaw) { body := strings.Builder{} @@ -105,8 +103,7 @@ func (the *Storage2Es) SaveVib(dataList []common_models.EsVbRaw) { `, the.vibIndex, _id, source) body.WriteString(s) } - //the.esHelper.BulkWrite(the.vibIndex, body.String()) - newEsHelper().BulkWrite(the.vibIndex, body.String()) + the.esHelper.BulkWrite(the.vibIndex, body.String()) } // SaveGroupTheme 分组主题数据写入ES diff --git a/storage/storageDBs/storage2InfluxDB.go b/storage/storageDBs/storage2InfluxDB.go index b60b8f0..9d62fb4 100644 --- a/storage/storageDBs/storage2InfluxDB.go +++ b/storage/storageDBs/storage2InfluxDB.go @@ -90,7 +90,7 @@ func (the *Storage2InfluxDB) SaveTheme(dataList []common_models.EsTheme) { } fields := transform.Obj2mapStr(d.Data) - line := fmt.Sprintf("%d %s %d", d.Sensor, fields, d.CollectTime.UnixNano()) + line := fmt.Sprintf("factor_%d,sensor_id=%d %s %d", d.Factor, d.Sensor, fields, d.CollectTime.UnixNano()) sb = append(sb, line) } the.influxDBHelper.Write(sb, the.themeBucket)