// the find
elastic/go-elasticsearch
The official Go client for Elasticsearch
The official Go client for Elasticsearch, maintained by Elastic. It ships two APIs: a low-level one that maps directly to REST endpoints and a typed API with generated structs for every request/response shape. This is the library you reach for when you're running Go services against Elasticsearch and want something that tracks ES version compatibility.
The typed API is the real win here — generated request/response types mean you get compile-time errors instead of runtime JSON surprises when the query DSL changes. The `esutil.BulkIndexer` helper handles the bulk indexing protocol correctly, including retry on partial failures, which is easy to get wrong yourself. The library explicitly supports running multiple major versions side-by-side via Go module major version paths, which matters in shops doing a staged ES upgrade. The test suite covers unit, integration, and API layers separately, and CI is clearly wired up and green.
The `.doc/examples/` directory is a graveyard of asciidoc files with hash names — there's no discoverable example index and the README just punts you to elastic.co docs. The typed API code is entirely generated, so when you hit a bug in a request struct you're filing an issue and waiting; you can't easily patch and vendor it. Version compatibility is forward-only with no backward-compatibility guarantees, which means a minor ES cluster upgrade can silently break assumptions in the client. The low-level API returns `*esapi.Response` wrapping a raw `http.Response`, so you're manually closing bodies and parsing JSON everywhere — it's verbose and error-prone compared to clients in other ecosystems.