From 31a59cb8e6cfd9128a708d77ca975ef5b7138730 Mon Sep 17 00:00:00 2001 From: liugq Date: Wed, 2 Aug 2023 20:36:24 +0800 Subject: [PATCH] remove specify _source field(adapter with easysearch) --- modules/agent/common/helper.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/agent/common/helper.go b/modules/agent/common/helper.go index 48b12429..ff47c752 100644 --- a/modules/agent/common/helper.go +++ b/modules/agent/common/helper.go @@ -347,7 +347,6 @@ func GetLatestOnlineAgentIDs(agentIds []string, lastSeconds int) (map[string]str }) } queryDSL := util.MapStr{ - "_source": "agent.id", "sort": []util.MapStr{ { "timestamp": util.MapStr{ @@ -375,6 +374,8 @@ func GetLatestOnlineAgentIDs(agentIds []string, lastSeconds int) (map[string]str } if len(agentIds) == 0 { queryDSL["size"] = 2000 + }else{ + queryDSL["size"] = len(agentIds) } q.RawQuery = util.MustToJSONBytes(queryDSL) err, result := orm.Search(event.Event{}, &q)