remove specify _source field(adapter with easysearch)

This commit is contained in:
liugq 2023-08-02 20:36:24 +08:00
parent a5fee144d9
commit 31a59cb8e6
1 changed files with 2 additions and 1 deletions

View File

@ -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)