From b5965f7db2c1e00b04d0cf4a9a0d9d347233b6d9 Mon Sep 17 00:00:00 2001 From: sunty <1172534965@qq.com> Date: 星期四, 25 七月 2019 17:25:59 +0800 Subject: [PATCH] fix updateVideourlById --- EsApi.go | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/EsApi.go b/EsApi.go index 122178e..4aff237 100644 --- a/EsApi.go +++ b/EsApi.go @@ -173,7 +173,7 @@ //鏍规嵁鎶撴媿浜哄憳id鏇存柊锛坴ideourl锛夋憚鍍忔満鍦板潃 -func updateVideourlById(id string, videoUrl string, indexName string, serverIp string, serverPort string)(statu int){ +func UpdateVideourlById(id string, videoUrl string, indexName string, serverIp string, serverPort string)(statu int){ var info interface{} var videoUrlInfo = ` { @@ -187,7 +187,7 @@ } } ` - buf, err := EsReq("POST", "http://"+serverIp+":"+serverPort+"/"+indexName+"/_search",[]byte(videoUrlInfo)) + buf, err := EsReq("POST", "http://"+serverIp+":"+serverPort+"/"+indexName+"/_update_by_query",[]byte(videoUrlInfo)) if err != nil { fmt.Println("http request videoUrlInfo info is err!") statu = 500 @@ -201,7 +201,7 @@ return } - middle, ok := out["updated"].(int) + middle, ok := out["updated"].(float64) if !ok { fmt.Println("first updated change error!") statu = 500 -- Gitblit v1.8.0