Skip to content

Commit

Permalink
[elastic] switches messages index revision 🔄
Browse files Browse the repository at this point in the history
  • Loading branch information
Seklfreak committed Dec 30, 2018
1 parent e2f4e33 commit acbb6da
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions migrations/45_create_elastic_index_messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func m45_create_elastic_index_messages() {
}

elastic := cache.GetElastic()
exists, err := elastic.IndexExists("robyul-messages").Do(context.Background())
exists, err := elastic.IndexExists("robyul-messages-v2").Do(context.Background())
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -67,7 +67,7 @@ func m45_create_elastic_index_messages() {
},
}

index, err := elastic.CreateIndex("robyul-messages").BodyJson(messageMapping).Do(context.Background())
index, err := elastic.CreateIndex("robyul-messages-v2").BodyJson(messageMapping).Do(context.Background())
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion migrations/51_reindex_elasticv5_to_v6.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func m51_reindex_elasticv5_to_v6() {
cache.GetLogger().WithField("module", "migrations").Info("reindexing ElasticSearch indexes")

src := elastic.NewReindexSource().Index("robyul").Type("message")
dst := elastic.NewReindexDestination().Index("robyul-messages").Type("doc")
dst := elastic.NewReindexDestination().Index("robyul-messages-v2").Type("doc")
res, err := elasticClient.Reindex().Source(src).Destination(dst).Refresh("true").Do(context.Background())
if err != nil {
panic(err)
Expand Down
2 changes: 1 addition & 1 deletion models/elastic.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package models
import "time"

const (
ElasticIndexMessages = "robyul-messages"
ElasticIndexMessages = "robyul-messages-v2"
ElasticIndexJoins = "robyul-joins"
ElasticIndexLeaves = "robyul-leaves"
ElasticIndexPresenceUpdates = "robyul-presence_updates"
Expand Down

0 comments on commit acbb6da

Please sign in to comment.