Commit b7669d9d authored by 李科's avatar 李科

fix: opensearch连接的空索引查询_doc的id最大值转换问题

parent f90898aa
...@@ -686,7 +686,7 @@ func (a *AlertSvc) GetIndexMaxID(indexName ...string) (maxId int, err error) { ...@@ -686,7 +686,7 @@ func (a *AlertSvc) GetIndexMaxID(indexName ...string) (maxId int, err error) {
aggregations := responseMap["aggregations"].(map[string]interface{}) aggregations := responseMap["aggregations"].(map[string]interface{})
maxIDAgg := aggregations["max_id"].(map[string]interface{}) maxIDAgg := aggregations["max_id"].(map[string]interface{})
maxIDValue := maxIDAgg["value"] maxIDValue := maxIDAgg["value"]
maxId = int(maxIDValue.(float64)) maxId = cast.ToInt(maxIDValue)
return maxId, nil return maxId, nil
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment