significantly improve log search performance
Signed-off-by: huanggze <loganhuang@yunify.com>
This commit is contained in:
@@ -24,10 +24,11 @@ func New(address string, index string) (*Elastic, error) {
|
||||
return &Elastic{client: client, index: index}, err
|
||||
}
|
||||
|
||||
func (e *Elastic) Search(body []byte, scroll bool) ([]byte, error) {
|
||||
func (e *Elastic) Search(indices string, body []byte, scroll bool) ([]byte, error) {
|
||||
opts := []func(*esapi.SearchRequest){
|
||||
e.client.Search.WithContext(context.Background()),
|
||||
e.client.Search.WithIndex(fmt.Sprintf("%s*", e.index)),
|
||||
e.client.Search.WithIndex(indices),
|
||||
e.client.Search.WithIgnoreUnavailable(true),
|
||||
e.client.Search.WithBody(bytes.NewBuffer(body)),
|
||||
}
|
||||
if scroll {
|
||||
|
||||
Reference in New Issue
Block a user