From 083c6458491aa80568ddc5be55d7650f6223998a Mon Sep 17 00:00:00 2001 From: zouap Date: Thu, 24 Feb 2022 15:22:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=94=A8=E6=88=B7=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- public/home/search.js | 4 ++-- routers/search.go | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/public/home/search.js b/public/home/search.js index 34fb9f5b3..79615c4f2 100644 --- a/public/home/search.js +++ b/public/home/search.js @@ -155,14 +155,14 @@ function displayDataSetResult(page,jsonResult,onlyReturnNum,keyword){ html += " " +recordMap["download_times"] + " "; html +=" "; html += "
"; - html += " " + recordMap["repoUrl"] + ""; + html += " " + recordMap["repoUrl"] + ""; html +=" "; html +="
"; html += "
"; html += "

" + recordMap["description"] + "

"; html += "

" + recordMap["file_name"] + "

"; html +="

"; - html +=" 最后更新于 " + getTime(recordMap["updated_unix"],currentTime) +""; + html +=" 最后更新于 " + getTime(recordMap["created_unix"],currentTime) +""; html +="

"; html +="
"; html +=" "; diff --git a/routers/search.go b/routers/search.go index dfc18f38e..e403ecbb1 100644 --- a/routers/search.go +++ b/routers/search.go @@ -394,6 +394,8 @@ func searchDataSet(ctx *context.Context, TableName string, Key string, Page int, boolQ.Should(nameQuery, descQuery, categoryQuery, fileNameQuery) res, err := client.Search(TableName).Query(boolQ).Sort(SortBy, ascending).From((Page - 1) * PageSize).Size(PageSize).Highlight(queryHighlight("title", "description", "file_name", "category")).Do(ctx.Req.Context()) if err == nil { + searchJson, _ := json.Marshal(res) + log.Info("searchJson=" + string(searchJson)) result := makeDatasetResult(res, Key, OnlyReturnNum) ctx.JSON(200, result) } else { @@ -404,6 +406,8 @@ func searchDataSet(ctx *context.Context, TableName string, Key string, Page int, //搜索的属性要指定{"timestamp":{"unmapped_type":"date"}} res, err := client.Search(TableName).Sort(SortBy, ascending).From((Page - 1) * PageSize).Size(PageSize).Do(ctx.Req.Context()) if err == nil { + searchJson, _ := json.Marshal(res) + log.Info("searchJson=" + string(searchJson)) result := makeDatasetResult(res, "", OnlyReturnNum) ctx.JSON(200, result) } else {