减少传输耗时

This commit is contained in:
2024-11-19 00:51:57 +08:00
parent 8d1b13ac82
commit 8b369085c0
4 changed files with 33 additions and 27 deletions

View File

@@ -47,19 +47,19 @@ type Response struct {
ID string `json:"_id"`
Score float64 `json:"_score"`
Timestamp string `json:"@timestamp"`
Source struct {
Timestamp string `json:"@timestamp"`
Athlete string `json:"Athlete"`
City string `json:"City"`
Country string `json:"Country"`
Discipline string `json:"Discipline"`
Event string `json:"Event"`
Gender string `json:"Gender"`
Medal string `json:"Medal"`
Season string `json:"Season"`
Sport string `json:"Sport"`
Year int `json:"Year"`
} `json:"_source"`
//Source struct {
// Timestamp string `json:"@timestamp"`
// Athlete string `json:"Athlete"`
// City string `json:"City"`
// Country string `json:"Country"`
// Discipline string `json:"Discipline"`
// Event string `json:"Event"`
// Gender string `json:"Gender"`
// Medal string `json:"Medal"`
// Season string `json:"Season"`
// Sport string `json:"Sport"`
// Year int `json:"Year"`
//} `json:"_source"`
} `json:"hits"`
} `json:"hits"`
}
@@ -148,7 +148,8 @@ func ZincSearch(query map[string]interface{}) (rest Response, err error) {
log.Println("解析响应失败", err)
return
}
return
return rest, err
}
func ZincPut(data map[string]interface{}) (err error) {