|
@@ -178,3 +178,17 @@ func TestElastic_SaveDocument(t *testing.T) {
|
|
|
err := esClinet.SaveDocument("bidding", data)
|
|
|
assert.Equal(t, nil, err)
|
|
|
}
|
|
|
+
|
|
|
+func TestElastic_GetById(t *testing.T) {
|
|
|
+ esClinet = Elastic{
|
|
|
+ S_esurl: "http://127.0.0.1:19805",
|
|
|
+ I_size: 2,
|
|
|
+ Username: "es_all",
|
|
|
+ Password: "TopJkO2E_d1x",
|
|
|
+ }
|
|
|
+ esClinet.InitElasticSize()
|
|
|
+
|
|
|
+ err, doc := esClinet.GetById("bidding", "59ed510d40d2d9bbe85dd221")
|
|
|
+ assert.Equal(t, nil, err)
|
|
|
+ fmt.Println("doc", doc)
|
|
|
+}
|