feat:完善产品详情
This commit is contained in:
23
serve/es/es_test.go
Normal file
23
serve/es/es_test.go
Normal file
@ -0,0 +1,23 @@
|
||||
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)
|
||||
}
|
Reference in New Issue
Block a user