Getting started with the APIedit

The new typed client can be obtained from the elasticsearch package using the NewTypedClient function. This new API takes the same arguments as the previous one and uses the same transport underneath.

Connection to an Elasticsearch cluster is identical to the existing client, only the API changes:

client, err := elasticsearch.NewTypedClient(elasticsearch.Config{
	// Proper configuration for your {es} cluster.

The code is generated from the elasticsearch-specification.