Skip to content
Snippets Groups Projects
Commit 64244977 authored by Nick Thomas's avatar Nick Thomas
Browse files

Add the index name to the indexer

parent f27c5260
No related branches found
No related tags found
1 merge request!1Initial implementation of an elasticsearch indexer in Go
Loading
Loading
@@ -14,7 +14,8 @@ type Submitter interface {
}
 
type Indexer struct {
Repo *git.Repo
IndexName string
Repo *git.Repo
Submitter
}
 
Loading
Loading
Loading
Loading
@@ -39,7 +39,15 @@ func main() {
log.Printf("Indexing from %s to %s", repo.FromHash, repo.ToHash)
log.Printf("Project ID: %s, Rails env: %s", projectID, railsEnv)
 
idx := &indexer.Indexer{Submitter: esClient, Repo: repo}
idx := &indexer.Indexer{
IndexName: "gitlab",
Submitter: esClient,
Repo: repo,
}
if railsEnv != "" {
idx.IndexName = idx.IndexName + "-" + railsEnv
}
 
if err := idx.Index(); err != nil {
log.Fatalln("Indexing error: ", err)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment