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 {