Skip to content
Snippets Groups Projects

Initial implementation of an elasticsearch indexer in Go

Merged Nick Thomas requested to merge 1-initial-implementation into master
All threads resolved!
5 files
+ 101
80
Compare changes
  • Side-by-side
  • Inline
Files
5
+ 7
4
@@ -23,12 +23,15 @@ type Client struct {
bulk *elastic.BulkProcessor
}
func (c *Client) Close() error {
return c.bulk.Close()
func (c *Client) Flush() error {
return c.bulk.Flush()
}
func NewClient(config *Config) (*Client, error) {
opts := []elastic.ClientOptionFunc{elastic.SetURL(config.URL...)}
opts := []elastic.ClientOptionFunc{
elastic.SetURL(config.URL...),
elastic.SetSniff(false), // For now. Move back to AWS-only later
}
// Sniffer should look for HTTPS URLs if at-least-one initial URL is HTTPS
for _, url := range config.URL {
@@ -46,7 +49,7 @@ func NewClient(config *Config) (*Client, error) {
return nil, err
}
opts = append(opts, elastic.SetHttpClient(awsClient), elastic.SetSniff(false))
opts = append(opts, elastic.SetHttpClient(awsClient))
}
client, err := elastic.NewClient(opts...)
Loading