This documentation contains work-in-progress information for future Elastic Stack and Cloud releases. Use the version selector to view supported release docs. It also contains some Elastic Cloud serverless information. Check out our serverless docs for more details.
Getting started with the API
editGetting started with the API
editThe 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.