Calculating the Number of Logs in opensearch (#5352)
Calculating the Number of Logs Signed-off-by: chengdehao <dehaocheng@kubesphere.io> Signed-off-by: chengdehao <dehaocheng@kubesphere.io> Co-authored-by: chengdehao <dehaocheng@kubesphere.io>
This commit is contained in:
@@ -64,6 +64,7 @@ func (o *OpenSearch) Search(indices string, body []byte, scroll bool) ([]byte, e
|
||||
opts := []func(*opensearchapi.SearchRequest){
|
||||
o.client.Search.WithContext(context.Background()),
|
||||
o.client.Search.WithIndex(indices),
|
||||
o.client.Search.WithRestTotalHitsAsInt(true),
|
||||
o.client.Search.WithIgnoreUnavailable(true),
|
||||
o.client.Search.WithBody(bytes.NewBuffer(body)),
|
||||
}
|
||||
|
||||
@@ -63,6 +63,7 @@ func New(address string, basicAuth bool, username, password, index string) (*Ope
|
||||
func (o *OpenSearch) Search(indices string, body []byte, scroll bool) ([]byte, error) {
|
||||
opts := []func(*opensearchapi.SearchRequest){
|
||||
o.client.Search.WithContext(context.Background()),
|
||||
o.client.Search.WithRestTotalHitsAsInt(true),
|
||||
o.client.Search.WithIndex(indices),
|
||||
o.client.Search.WithIgnoreUnavailable(true),
|
||||
o.client.Search.WithBody(bytes.NewBuffer(body)),
|
||||
|
||||
Reference in New Issue
Block a user