Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

The official Go client for Elasticsearch

License

NotificationsYou must be signed in to change notification settings

elastic/go-elasticsearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

The official Go client forElasticsearch.

Download the latest version of Elasticsearchorsign-upfor a free trial of Elastic Cloud.

Go ReferenceGo Report Cardcodecov.ioBuildUnitIntegrationAPI

Compatibility

Go

Starting from version8.12.0, this library follow the Go languagepolicy. 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 backwards 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.xrequire github.com/elastic/go-elasticsearch/v8 v8.x.x

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

// go.modgithub.com/elastic/go-elasticsearch/v8 v8.18.0github.com/elastic/go-elasticsearch/v9 v9.0.0// main.goimport (  elasticsearch7 "github.com/elastic/go-elasticsearch/v8"  elasticsearch8 "github.com/elastic/go-elasticsearch/v9")// ...es8, _ := elasticsearch7.NewDefaultClient()es9, _ := elasticsearch8.NewDefaultClient()

Themain branch of the client is compatible with the currentmaster branch of Elasticsearch.

Installation

Refer to theInstallation sectionof the getting started documentation.

Connecting

Refer to theConnecting sectionof the getting started documentation.

Operations

Helpers

Theesutil package provides convenience helpers for working with the client. At the moment, it provides theesutil.JSONReader() and theesutil.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 theApache 2 license. SeeNOTICE.


[8]ページ先頭

©2009-2025 Movatter.jp