The Go client connects Go programs to Elasticsearch clusters. It follows Elasticsearch minor-version compatibility rules and ships helpers for bulk indexing and JSON bodies.
Overview
go-elasticsearch is Elastic’s supported Go client for talking to Elasticsearch over HTTP. Applications import versioned modules such as v8 or v9 to match their cluster.
The client is forward compatible with equal or newer Elasticsearch minor versions on default distributions. Documentation on elastic.co and pkg.go.dev covers configuration, TLS, connection setup, and request APIs.
The esutil package adds helpers including JSON readers and a bulk indexer for high-throughput indexing. Example code demonstrates custom transport, certificate authorities, mocked transports for tests, and bulk request patterns.
Multiple client major versions can coexist in one module via distinct import paths, which helps gradual upgrades across services.
Key features
- Official Elasticsearch client
- Versioned Go modules
- Bulk indexing helpers
- Configurable HTTP transport
- Documented connection setup
- Example recipes
Use cases
- Indexing from Go services
- Cluster search from backends
- Bulk data ingestion
- Elasticsearch-powered APIs