Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
G

go-elasticsearch

> 数据库
Open source

The official Go client for Elasticsearch

6.1K stars0 likes0 views
WebsiteGitHub

About

The official Go client for Elasticsearch

go-elasticsearch

The official Go client for Elasticsearch.

Download the latest version of Elasticsearch or sign-up for a free trial of Elastic Cloud.

Documentation

Find the full reference documentation at elastic.co:

  • Getting started
  • Configuration
  • Using the API (low-level and typed)
  • Typed API and esdsl builders
  • Advanced topics (interceptors, observability)

The Go package reference lives on pkg.go.dev.

Compatibility

Go

Starting from version 8.12.0, this library follows the Go language's release policy. Each major Go release is supported until there are two newer major releases. For example, Go 1.5 was supported until the Go 1.7 release, and Go 1.6 was supported until the Go 1.8 release.

Elasticsearch

Language clients are forward compatible; meaning that clients support communicating with greater or equal minor versions of Elasticsearch. Elasticsearch language clients are only backward compatible with default distributions and without guarantees made.

When using Go modules, include the version in the import path, and specify either an explicit version or a branch:

require github.com/elastic/go-elasticsearch/v9 v9.x.x
require github.com/elastic/go-elasticsearch/v8 v8.x.x

It's possible to use multiple versions of the client in a single project:

// go.mod
github.com/elastic/go-elasticsearch/v8 v8.18.0
github.com/elastic/go-elasticsearch/v9 v9.0.0

// main.go
import (
  elasticsearch8 "github.com/elastic/go-elasticsearch/v8"
  elasticsearch9 "github.com/elastic/go-elasticsearch/v9"
)
// ...
es8, _ := elasticsearch8.New()
es9, _ := elasticsearch9.New()

The main branch of the client is compatible with the current master branch of Elasticsearch.

Installation

Refer to the Installation page of the documentation.

Connecting

Refer to the Connecting page of the documentation.

Operations

  • Creating an index
  • Indexing documents
  • Getting documents
  • Searching documents
  • Updating documents
  • Deleting documents
  • Deleting an index

Helpers

The esutil package provides convenience helpers for working with the client. At the moment, it provides the esutil.JSONReader() and the esutil.BulkIndexer helpers.

Examples

The _examples folder contains a number of recipes and comprehensive examples to get you started with the client, including configuration and customization of the client, using a custom certificate authority (CA) for security (TLS), mocking the transport for unit tests, embedding the client in a custom type, building queries, performing requests individually and in bulk, and parsing the responses.

License

This software is licensed under the Apache 2 license. See NOTICE.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Goclientelasticsearchgogolang

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库