fix events search bug when no events

Signed-off-by: junotx <junotx@126.com>
This commit is contained in:
junotx
2020-07-22 11:25:59 +08:00
parent 26ac41d086
commit 393386a32a
2 changed files with 22 additions and 7 deletions

View File

@@ -98,7 +98,7 @@ func (c *ClientV6) parse(resp *es6api.Response, err error) (*Response, error) {
return nil, fmt.Errorf(resp.String())
}
var r struct {
Hits *struct {
Hits struct {
Total int64 `json:"total"`
Hits jsoniter.RawMessage `json:"hits"`
} `json:"hits"`
@@ -128,7 +128,7 @@ func (c *ClientV7) parse(resp *es7api.Response, err error) (*Response, error) {
return nil, fmt.Errorf(resp.String())
}
var r struct {
Hits *struct {
Hits struct {
Total struct {
Value int64 `json:"value"`
} `json:"total"`