Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change BulkIndexerConfig to improve comptability with both Client and TypedClient #653

Open
ludovic-franconieri opened this issue Apr 5, 2023 · 0 comments

Comments

@ludovic-franconieri
Copy link

Hello,

The BulkIndexerConfig ask for a Client *elasticsearch.Client

// BulkIndexerConfig represents configuration of the indexer.
type BulkIndexerConfig struct {
...
	Client      *elasticsearch.Client   // The Elasticsearch client.
...
}

Even though it only use the transport part :

func (r BulkRequest) Do(ctx context.Context, transport Transport) (*Response, error)

So, if you use a TypedClient, you can't use it in BulkIndexerConfig, you will have to instantiate a Client only for the BulkIndexerConfig.

What I propose is to change the BulkIndexerConfig to ask for a Transport so it can be compatible with both Client and TypedClient

// BulkIndexerConfig represents configuration of the indexer.
type BulkIndexerConfig struct {
...
	Transport   esapi.Transport         // The Elasticsearch transport.
...

If you want, I already push the changes in a branch => https://github.com/ludovic-franconieri/go-elasticsearch/tree/bulk_indexer_transport

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants