From 4a2eb6f75b11ccb95e67a6f1c3b7cdf5b2c14d0c Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期三, 03 七月 2019 10:39:00 +0800
Subject: [PATCH] only filter current analyServer es data

---
 controllers/dbtableperson.go |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/controllers/dbtableperson.go b/controllers/dbtableperson.go
index 86caa20..738128d 100644
--- a/controllers/dbtableperson.go
+++ b/controllers/dbtableperson.go
@@ -49,7 +49,7 @@
 func addDbPerson(dbperson *models.Dbtablepersons) (result map[string]interface{}) {
 
 	personId := uuid.NewV4().String() //  浠ュ悗鏇夸唬 渚濇嵁鐢熸垚瑙勫垯
-	dbperson.Uuid = personId
+	dbperson.Id = personId
 	dbperson.PriInsert()
 	url := "http://" + config.EsInfo.Masterip + ":" + config.EsInfo.Httpport +
 		"/" + config.EsInfo.EsIndex.Dbtablepersons.IndexName + "/" + config.EsInfo.EsIndex.Dbtablepersons.IndexType + "/" + personId + "?refresh=wait_for"
@@ -77,7 +77,7 @@
 func (dbc DbPersonController) UpdateDbPerson(c *gin.Context) {
 	var dbperson models.Dbtablepersons
 	c.BindJSON(&dbperson)
-	personid := dbperson.Uuid
+	personid := dbperson.Id
 	if personid == "" {
 		util.ResponseFormat(c, code.RequestParamError, nil)
 		return
@@ -222,8 +222,8 @@
 		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\":{\"must_not\":[" +
+		"{\"term\":{\"isDelete\":\"1\"}}],\"must_not\":[" + 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)

--
Gitblit v1.8.0