You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
343 B
22 lines
343 B
package EsUtil
|
|
|
|
import (
|
|
"context"
|
|
"dsSzxy/Utils/ConfigUtil"
|
|
"fmt"
|
|
"github.com/olivere/elastic/v7"
|
|
)
|
|
|
|
var EsClient *elastic.Client
|
|
var CTX context.Context
|
|
|
|
func init() {
|
|
esUrl := ConfigUtil.ESUrl
|
|
CTX = context.Background()
|
|
var err error
|
|
EsClient, err = elastic.NewClient(elastic.SetURL(esUrl))
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
}
|
|
}
|