You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The BulkIndexerConfig ask for a Client *elasticsearch.Client
// BulkIndexerConfig represents configuration of the indexer.typeBulkIndexerConfigstruct {
...Client*elasticsearch.Client// The Elasticsearch client....
}
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.typeBulkIndexerConfigstruct {
...Transport esapi.Transport// The Elasticsearch transport....
Another way to address the issue is to allow "converting" a TypedClient to a Client. You can kind-of already do this, and it works, but gives a go vet error. Patch to fix at: #905
Maybe a helper or some such might be nice too.
Personally I'd say that's enough to consider this fixed, and would be better than changing bulkindexer: it's fairly straight-forward, compatible, and simple.
Hello,
The
BulkIndexerConfig
ask for aClient *elasticsearch.Client
Even though it only use the transport part :
So, if you use a
TypedClient
, you can't use it inBulkIndexerConfig
, you will have to instantiate aClient
only for theBulkIndexerConfig
.What I propose is to change the
BulkIndexerConfig
to ask for aTransport
so it can be compatible with bothClient
andTypedClient
If you want, I already push the changes in a branch => https://github.com/ludovic-franconieri/go-elasticsearch/tree/bulk_indexer_transport
Thanks
The text was updated successfully, but these errors were encountered: