// InitES pings the ES Server.
// Returns an error if the connection did not succeed.
InitES pings the ES Server.
Returns an error if the connection did not succeed.
// InitES pings the ES Server . // Returns an error if the connection did not succeed .
func InitES(URL string) (string, error) {
	cfg := elasticsearch.Config {
		Addresses: []string{
			URL,
		  },
	}
	es, err := elasticsearch.NewClient(cfg)
	if err != nil {
	  return "", fmt.Errorf("Error creating the client: %s", err.Error())
	}
	client = es
	res, err := client.Info()
	if err != nil {
	   return "", fmt.Errorf("Error getting response: %s", err.Error())
	}
	defer res.Body.Close()
	return fmt.Sprintf("%+v", res), nil
}
func InitES ( URL string ) ( string , error ) { cfg := elasticsearch . Config { Addresses : [ ] string { URL , } , } es , err := elasticsearch . NewClient ( cfg ) if err != nil { return " " , fmt . Errorf ( " " , err . Error ( ) ) } client = es res , err := client . Info ( ) if err != nil { return " " , fmt . Errorf ( " " , err . Error ( ) ) } defer res . Body . Close ( ) return fmt . Sprintf ( " " , res ) , nil }
InitES pings the ES Server.
InitES pings the ES Server .