Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #76 from LF-Engineering/fix-elastic-auth0-compitab…
Browse files Browse the repository at this point in the history
…lity-issue

Log params on server not elastic error
  • Loading branch information
khalifapro authored Aug 13, 2021
2 parents b8ed531 + d6fb334 commit eeb8b29
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions elastic/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@ func NewClientProvider(params *Params) (*ClientProvider, error) {
Username: params.Username,
Password: params.Password,
}

client, err := elasticsearch.NewClient(config)
if err != nil {
return nil, err
}
return &ClientProvider{client}, err
return &ClientProvider{client, params}, err
}

// CheckIfIndexExists checks if an es index exists and returns a bool depending on whether it exists or not.
Expand Down Expand Up @@ -478,6 +477,9 @@ func (p *ClientProvider) Search(index string, query map[string]interface{}) ([]b
p.client.Search.WithBody(&buf),
)
if err != nil {
if strings.Contains(err.Error(), "server is not Elasticsearch") {
fmt.Println("esssssss", p.params)
}
return nil, err
}

Expand Down
1 change: 1 addition & 0 deletions elastic/dto.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
// ClientProvider ...
type ClientProvider struct {
client *elasticsearch.Client
params *Params
}

// Params ...
Expand Down

0 comments on commit eeb8b29

Please sign in to comment.