Files
2021-12-09 16:17:23 +08:00

24 lines
408 B
Go

package es
import (
"strings"
"testing"
)
var (
dataIndex = "test"
)
func TestNewInstance(t *testing.T) {
NewInstance(
WithEsAddress([]string{"http://192.168.0.188:9200"}),
).Init().Local()
var b strings.Builder
b.WriteString(`{"title" : "`)
b.WriteString("我是好人")
b.WriteString(`"}`)
resp, err := client.Create(dataIndex, "2", strings.NewReader(b.String()))
t.Log(err)
t.Log(resp)
}