update
This commit is contained in:
@@ -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()
|
||||
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user