From 2e9afa05653c2a2743e50b1e96ec6b5d37c8ea00 Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 7 Mar 2022 17:12:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81=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 797786c15..3a6eb3fdf 100644 --- a/routers/search.go +++ b/routers/search.go @@ -179,7 +179,7 @@ func searchRepo(ctx *context.Context, TableName string, Key string, Page int, Pa log.Info("query searchRepo start") if Key != "" { boolQ := elastic.NewBoolQuery() - nameQuery := elastic.NewMatchQuery("name", Key).Boost(1024).QueryName("f_first") + nameQuery := elastic.NewMatchQuery("alias", Key).Boost(1024).QueryName("f_first") descriptionQuery := elastic.NewMatchQuery("description", Key).Boost(1.5).QueryName("f_second") topicsQuery := elastic.NewMatchQuery("topics", Key).Boost(1).QueryName("f_third") boolQ.Should(nameQuery, descriptionQuery, topicsQuery) @@ -263,7 +263,7 @@ func makeRepoResult(sRes *elastic.SearchResult, Key string, OnlyReturnNum bool) if err == nil { record := make(map[string]interface{}) record["id"] = hit.Id - record["name"] = getLabelValue("name", recordSource, hit.Highlight) + record["alias"] = getLabelValue("alias", recordSource, hit.Highlight) record["real_name"] = recordSource["name"] record["owner_name"] = recordSource["owner_name"] if recordSource["description"] != nil {