This commit is contained in:
veypi
2020-12-21 10:40:31 +08:00
parent db7b3a2889
commit ce3e1a284d
21 changed files with 1280 additions and 13 deletions
+25
View File
@@ -0,0 +1,25 @@
# elasticsearch
## goang sdk
```go
// https://github.com/elastic/go-elasticsearch
import (
github.com/elastic/go-elasticsearch/v7
)
es, err := elasticsearch.NewClient(elasticsearch.Config{})
// create document
req := esapi.IndexRequest{
Index: "sample_edge",
Body: bytes.NewReader(body),
}
res, err := req.Do(context.Background(), es)
if err != nil {
return
}
defer res.Body.Close()
```