diff --git a/pkg/quickwit/client/client.go b/pkg/quickwit/client/client.go index 36059b2..f24bce7 100644 --- a/pkg/quickwit/client/client.go +++ b/pkg/quickwit/client/client.go @@ -168,7 +168,6 @@ func (c *baseClientImpl) ExecuteMultisearch(r *MultiSearchRequest) (*MultiSearch if res.StatusCode >= 400 { qe := QuickwitQueryError{ - Key: "msearch", Status: res.StatusCode, Message: "Error on multisearch", ResponseBody: res.Body, diff --git a/pkg/quickwit/client/models.go b/pkg/quickwit/client/models.go index 178c97e..e4769e1 100644 --- a/pkg/quickwit/client/models.go +++ b/pkg/quickwit/client/models.go @@ -46,7 +46,6 @@ type SearchResponseHits struct { type QuickwitQueryError struct { Status int `json:"status"` - Key string `json:"key"` Message string `json:"message"` ResponseBody io.ReadCloser `json:"response_body"` RequestBody []*SearchRequest `json:"request_body"` diff --git a/pkg/quickwit/data_query.go b/pkg/quickwit/data_query.go index e84ae8f..788f86a 100644 --- a/pkg/quickwit/data_query.go +++ b/pkg/quickwit/data_query.go @@ -28,7 +28,7 @@ var newElasticsearchDataQuery = func(client es.Client, dataQuery []backend.DataQ } } -func handleQuickwitErrors(err error) (*backend.QueryDataResponse, error) { +func handleQuickwitErrors(e *elasticsearchDataQuery, err error) (*backend.QueryDataResponse, error) { if nil == err { return nil, nil } @@ -44,7 +44,7 @@ func handleQuickwitErrors(err error) (*backend.QueryDataResponse, error) { Responses: backend.Responses{}, } - result.Responses[qe.Key] = backend.ErrDataResponse(backend.Status(qe.Status), payload) + result.Responses[e.dataQueries[0].RefID] = backend.ErrDataResponse(backend.Status(qe.Status), payload) return &result, nil } @@ -70,7 +70,7 @@ func (e *elasticsearchDataQuery) execute() (*backend.QueryDataResponse, error) { } res, err := e.client.ExecuteMultisearch(req) - result, err := handleQuickwitErrors(err) + result, err := handleQuickwitErrors(e, err) if result != nil { return result, nil } else if err != nil {