From a06c77798dc1d1b8cad28e00aaf11b9e8c4f4fdc Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 27 Dec 2021 10:48:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=90=9C=E7=B4=A2=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/search.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routers/search.go b/routers/search.go index 6bb8e10f9..15f7d1055 100644 --- a/routers/search.go +++ b/routers/search.go @@ -43,9 +43,9 @@ func Search(ctx *context.Context) { boolQ := elastic.NewBoolQuery() nameQuery := elastic.NewMatchQuery("name", Key).Boost(2) descriptionQuery := elastic.NewMatchQuery("description", Key).Boost(1) - owner_idQuery := elastic.NewTermQuery("owner_id", 3) + //owner_idQuery := elastic.NewTermQuery("owner_id", 3) boolQ.Should(nameQuery, descriptionQuery) - boolQ.Must(owner_idQuery) + //boolQ.Must(owner_idQuery) res, err := client.Search(TableName + "-es-index").Query(boolQ).Do(ctx.Req.Context()) if err == nil { ctx.JSON(200, res)