|
|
@@ -103,14 +103,14 @@ func TestDeleteEggScoreIndex(t *testing.T) { |
|
|
|
|
|
|
|
// 创建临时蛋蛋分记录 |
|
|
|
func TestCreateTempEggScoreIndex(t *testing.T) { |
|
|
|
es.Init("http://120.55.48.175:9200", "elastic", "fnuo123") |
|
|
|
index := fmt.Sprintf("%s_%d_1", md.EggEnergyUserEggScoreEsAlias, 202451) |
|
|
|
es.Init("http://123.57.140.192:9200/", "elastic", "fnuo123") |
|
|
|
index := fmt.Sprintf("%s_%d", md.EggEnergyUserEggScoreEsAlias, 202451) |
|
|
|
err := es.CreateIndexIfNotExists(index, md.EggEnergyUserEggScoreEsMapping) |
|
|
|
if err != nil { |
|
|
|
fmt.Println(err) |
|
|
|
} |
|
|
|
|
|
|
|
for i := 1; i < 650; i++ { |
|
|
|
for i := 1; i < 41; i++ { |
|
|
|
egg_energy.ExistOrDefaultUserEggScore(int64(i)) |
|
|
|
} |
|
|
|
|
|
|
@@ -125,11 +125,6 @@ func TestCreateEggScoreIndex(t *testing.T) { |
|
|
|
if err != nil { |
|
|
|
fmt.Println(err) |
|
|
|
} |
|
|
|
index2 := fmt.Sprintf("%s_%d", md.EggEnergyUserEggScoreEsAlias, 202452) |
|
|
|
err = es.CreateIndexIfNotExists(index2, md.EggEnergyUserEggScoreEsMapping) |
|
|
|
if err != nil { |
|
|
|
fmt.Println(err) |
|
|
|
} |
|
|
|
|
|
|
|
fmt.Println("success") |
|
|
|
} |