From 11164b48c94572573b51c380894763008f6010f6 Mon Sep 17 00:00:00 2001 From: sunty <suntianyu0923@163.com> Date: 星期二, 30 七月 2019 17:15:46 +0800 Subject: [PATCH] delete EndTime omitempty --- controllers/dbtablesCon.go | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/controllers/dbtablesCon.go b/controllers/dbtablesCon.go index ec2735b..5d69e24 100644 --- a/controllers/dbtablesCon.go +++ b/controllers/dbtablesCon.go @@ -38,6 +38,9 @@ } else if isSync == "2" { analyServerFilterStr = "{\"term\":{\"analyServerId\":\"" + sysconf.ServerId + "\"}}" // 鏈湴搴� } + if analyServerFilterStr !="" { + analyServerFilterStr = ","+ analyServerFilterStr + } params := "{\"query\":{\"bool\":{\"must\":[" + "{\"term\":{\"isDelete\":\"0\"}}" + analyServerFilterStr + "]}}," + "\"from\":0,\"size\":1000,\"sort\":{\"id\":{\"order\":\"asc\"}}}" @@ -153,7 +156,7 @@ uuid := c.Params.ByName("id") url := "http://" + config.EsInfo.Masterip + ":" + config.EsInfo.Httpport + "/" + config.EsInfo.EsIndex.DbTables.IndexName + "/" + config.EsInfo.EsIndex.DbTables.IndexType + "/" + uuid + "/_update?refresh=wait_for" - params := "{\"doc\":{\"isDelete\":\"1\"}}" + params := "{\"doc\":{\"isDelete\":1}}" logger.Debug("鍒犻櫎璇锋眰url:%s;\n 璇锋眰鍙傛暟params:%s", url, params) data := esutil.GetEsDataReq(url, params, false) //c.JSON(200, changeEsRespData(data, "鍒犻櫎鎴愬姛")) -- Gitblit v1.8.0