Skip to content

Commit

Permalink
collections index initial impl
Browse files Browse the repository at this point in the history
  • Loading branch information
miiu96 committed Jun 23, 2022
1 parent 3db265a commit a73c8e9
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 0 deletions.
2 changes: 2 additions & 0 deletions constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ const (
DelegatorsIndex = "delegators"
// OperationsIndex is the Elasticsearch index for transactions and smart contract results
OperationsIndex = "operations"
// CollectionsIndex is the Elasticsearch index for collections
CollectionsIndex = "collections"

// TransactionsPolicy is the Elasticsearch policy for the transactions
TransactionsPolicy = "transactions_policy"
Expand Down
1 change: 1 addition & 0 deletions process/elasticProcessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ var (
elasticIndexer.TransactionsIndex, elasticIndexer.BlockIndex, elasticIndexer.MiniblocksIndex, elasticIndexer.RatingIndex, elasticIndexer.RoundsIndex, elasticIndexer.ValidatorsIndex,
elasticIndexer.AccountsIndex, elasticIndexer.AccountsHistoryIndex, elasticIndexer.ReceiptsIndex, elasticIndexer.ScResultsIndex, elasticIndexer.AccountsESDTHistoryIndex, elasticIndexer.AccountsESDTIndex,
elasticIndexer.EpochInfoIndex, elasticIndexer.SCDeploysIndex, elasticIndexer.TokensIndex, elasticIndexer.TagsIndex, elasticIndexer.LogsIndex, elasticIndexer.DelegatorsIndex, elasticIndexer.OperationsIndex,
elasticIndexer.CollectionsIndex,
}
)

Expand Down
1 change: 1 addition & 0 deletions process/templatesAndPolicies/noKibana.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func (tr *templatesAndPolicyReaderNoKibana) GetElasticTemplatesAndPolicies() (ma
indexTemplates[indexer.LogsIndex] = noKibana.Logs.ToBuffer()
indexTemplates[indexer.DelegatorsIndex] = noKibana.Delegators.ToBuffer()
indexTemplates[indexer.OperationsIndex] = noKibana.Operations.ToBuffer()
indexTemplates[indexer.CollectionsIndex] = noKibana.Collections.ToBuffer()

return indexTemplates, indexPolicies, nil
}
1 change: 1 addition & 0 deletions process/templatesAndPolicies/withKibana.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func getTemplatesKibana() map[string]*bytes.Buffer {
indexTemplates[indexer.LogsIndex] = withKibana.Logs.ToBuffer()
indexTemplates[indexer.DelegatorsIndex] = withKibana.Delegators.ToBuffer()
indexTemplates[indexer.OperationsIndex] = withKibana.Operations.ToBuffer()
indexTemplates[indexer.CollectionsIndex] = withKibana.Collections.ToBuffer()

return indexTemplates
}
Expand Down
16 changes: 16 additions & 0 deletions templates/noKibana/collections.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package noKibana

// Collections will hold the configuration for the collections index
var Collections = Object{
"index_patterns": Array{
"collections-*",
},
"settings": Object{
"number_of_shards": 3,
"number_of_replicas": 0,
},

"mappings": Object{
"dynamic": false,
},
}
16 changes: 16 additions & 0 deletions templates/withKibana/collections.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package withKibana

// Collections will hold the configuration for the collections index
var Collections = Object{
"index_patterns": Array{
"collections-*",
},
"settings": Object{
"number_of_shards": 3,
"number_of_replicas": 0,
},

"mappings": Object{
"dynamic": false,
},
}

0 comments on commit a73c8e9

Please sign in to comment.