From e83dc9c5ecbcc4f97da67f6fb5a1a352e0c9efb9 Mon Sep 17 00:00:00 2001 From: liuxiaolong <736321739@qq.com> Date: 星期一, 08 七月 2019 19:36:01 +0800 Subject: [PATCH] gb28181set --- controllers/dbtableperson.go | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/controllers/dbtableperson.go b/controllers/dbtableperson.go index 738128d..0e9e2fa 100644 --- a/controllers/dbtableperson.go +++ b/controllers/dbtableperson.go @@ -209,7 +209,7 @@ if tableId == "all" || tableId == "" { // / 鎵�鏈変汉鍛� } else { - syncTerm = ",{\"term\":{\"tableId\":\"" + tableId + "\"}}" // 搴曞簱浜哄憳 + syncTerm = "{\"term\":{\"tableId\":\"" + tableId + "\"}}" // 搴曞簱浜哄憳 } if contentValue != "" { contentParam = ",\"must\":[{\"multi_match\":{\"query\":\"" + contentValue + "\",\"type\":\"best_fields\"," + @@ -223,7 +223,7 @@ } params := "{\"query\":{\"bool\":{\"must_not\":[" + - "{\"term\":{\"isDelete\":\"1\"}}],\"must_not\":[" + syncTerm + "]" + contentParam + "}},\"from\":" + strconv.Itoa(from) + ",\"size\":" + strconv.Itoa(size) + ",\"sort\":{\"" + orderName + "\":{\"order\":\"" + orderType + "\"}}}" + "{\"term\":{\"isDelete\":\"1\"}}],\"filter\":[" + syncTerm + "]" + contentParam + "}},\"from\":" + strconv.Itoa(from) + ",\"size\":" + strconv.Itoa(size) + ",\"sort\":{\"" + orderName + "\":{\"order\":\"" + orderType + "\"}}}" fmt.Print("璇锋眰url:%s;\n 璇锋眰鍙傛暟params:%s", url, params) data := esutil.GetEsDataReq(url, params, true) //c.JSON(200, data) @@ -280,7 +280,7 @@ if tableId == "all" || tableId == "" { // / 鎵�鏈変汉鍛� } else { - syncTerm = ",{\"term\":{\"tableId\":\"" + tableId + "\"}}" // 搴曞簱浜哄憳 + syncTerm = "{\"term\":{\"tableId\":\"" + tableId + "\"}}" // 搴曞簱浜哄憳 } if orderType == "desc" { orderType = "desc" @@ -288,8 +288,10 @@ orderType = "asc" } - params := "{\"query\":{\"bool\":{\"filter\":[" + - "{\"term\":{\"isDelete\":\"0\"}}" + syncTerm + "]" + contentParam + "}},\"from\":" + strconv.Itoa(from) + ",\"size\":" + strconv.Itoa(size) + ",\"sort\":{\"" + orderName + "\":{\"order\":\"" + orderType + "\"}}}" + //params := "{\"query\":{\"bool\":{\"filter\":[" + + // "{\"term\":{\"isDelete\":\"0\"}}" + syncTerm + "]" + contentParam + "}},\"from\":" + strconv.Itoa(from) + ",\"size\":" + strconv.Itoa(size) + ",\"sort\":{\"" + orderName + "\":{\"order\":\"" + orderType + "\"}}}" + params := "{\"query\":{\"bool\":{\"must_not\":[" + + "{\"term\":{\"isDelete\":\"1\"}}],\"filter\":[" + syncTerm + "]" + contentParam + "}},\"from\":" + strconv.Itoa(from) + ",\"size\":" + strconv.Itoa(size) + ",\"sort\":{\"" + orderName + "\":{\"order\":\"" + orderType + "\"}}}" fmt.Print("璇锋眰url:%s;\n 璇锋眰鍙傛暟params:%s", url, params) data := esutil.GetEsDataReq(url, params, true) featByte := make([]byte, 0, 1024) -- Gitblit v1.8.0