|
2 | 2 |
|
3 | 3 | == Overview |
4 | 4 |
|
5 | | -* https://github.com/elastic/go-elasticsearch |
6 | | -* https://godoc.org/github.com/elastic/go-elasticsearch |
7 | | -* https://github.com/elastic/go-elasticsearch/tree/master/_examples |
| 5 | +An official Go client for Elasticsearch. |
8 | 6 |
|
| 7 | +Full documentation is hosted at https://github.com/elastic/go-elasticsearch[GitHub] |
| 8 | +and https://godoc.org/github.com/elastic/go-elasticsearch[GoDoc] |
| 9 | +-- this page provides only an overview. |
| 10 | + |
| 11 | +.Work In Progress |
| 12 | +************************************************************************************ |
| 13 | +The client is currently available as a public preview. We encourage you to try the |
| 14 | +package in your projects, but please be aware that the public API may change. |
| 15 | +************************************************************************************ |
| 16 | + |
| 17 | +=== Elasticsearch Version Compatibility |
| 18 | + |
| 19 | +The client major versions correspond to the Elasticsearch major versions: |
| 20 | +to connect to Elasticsearch `6.x`, use a `6.x` version of the client, |
| 21 | +to connect to Elasticsearch `7.x`, use a `7.x` version of the client, and so on. |
| 22 | + |
| 23 | +The `master` branch of the client is compatible with the `master` branch of Elasticsearch. |
| 24 | + |
| 25 | +=== Installation |
| 26 | + |
| 27 | +Add the package to your `go.mod` file: |
| 28 | + |
| 29 | +[source,text] |
| 30 | +------------------------------------ |
| 31 | +require github.com/elastic/go-elasticsearch {VERSION} |
| 32 | +------------------------------------ |
| 33 | + |
| 34 | +=== Usage |
| 35 | + |
| 36 | +[source,go] |
| 37 | +------------------------------------ |
| 38 | +package main |
| 39 | +
|
| 40 | +import ( |
| 41 | + "log" |
| 42 | +
|
| 43 | + "github.com/elastic/go-elasticsearch" |
| 44 | +) |
| 45 | +
|
| 46 | +func main() { |
| 47 | + es, _ := elasticsearch.NewDefaultClient() |
| 48 | + log.Println(es.Info()) |
| 49 | +} |
| 50 | +------------------------------------ |
| 51 | + |
| 52 | +[NOTE] |
| 53 | +Please have a look at the collection of comprehensive examples in the repository |
| 54 | +at https://github.com/elastic/go-elasticsearch/tree/master/_examples. |
| 55 | + |
| 56 | +== Resources |
| 57 | + |
| 58 | +* https://github.com/elastic/go-elasticsearch[Source Code] |
| 59 | +* https://godoc.org/github.com/elastic/go-elasticsearch[API Documentation] |
| 60 | +* https://github.com/elastic/go-elasticsearch/tree/master/_examples[Examples and Recipes] |
| 61 | + |
| 62 | +== License |
| 63 | + |
| 64 | +Copyright 2019-present Elasticsearch |
| 65 | + |
| 66 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 67 | +you may not use this file except in compliance with the License. |
| 68 | +You may obtain a copy of the License at |
| 69 | + |
| 70 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 71 | + |
| 72 | +Unless required by applicable law or agreed to in writing, software |
| 73 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 74 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 75 | +See the License for the specific language governing permissions and |
| 76 | +limitations under the License. |
0 commit comments