Browse Source

增加用户搜索结果

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.3.2^2
zouap 4 years ago
parent
commit
44dd23a4bb
2 changed files with 54 additions and 2 deletions
  1. +53
    -2
      public/home/search.js
  2. +1
    -0
      routers/search.go

+ 53
- 2
public/home/search.js View File

@@ -130,6 +130,49 @@ function displayPrResult(page,jsonResult,onlyReturnNum,keyword){
}
}

var categoryDesc={
"computer_vision":"计算机视觉",
"natural_language_processing":"自然语言处理",
"speech_processing":"语音处理",
"computer_vision_natural_language_processing":"计算机视觉、自然语言处理"
};

var taskDesc={
"machine_translation":"机器翻译",
"question_answering_system":"问答系统",
"information_retrieval":"信息检索",
"knowledge_graph":"知识图谱",
"text_annotation":"文本标注",
"text_categorization":"文本分类",
"emotion_analysis":"情感分析",
"language_modeling":"语言建模",
"speech_recognition":"语音识别",
"automatic_digest":"自动文摘",
"information_extraction":"信息抽取",
"description_generation":"说明生成",
"image_classification":"图像分类",
"face_recognition":"人脸识别",
"image_search":"图像搜索",
"target_detection":"目标检测",
"image_description_generation":"图像描述生成",
"vehicle_license_plate_recognition":"车辆车牌识别",
"medical_image_analysis":"医学图像分析",
"unmanned":"无人驾驶",
"unmanned_security":"无人安防",
"drone":"无人机",
"vr_ar":"VR/AR",
"2_d_vision":"2-D视觉",
"2_5_d_vision":"2.5-D视觉",
"3_d_reconstruction":"3D重构",
"image_processing":"图像处理",
"video_processing":"视频处理",
"visual_input_system":"视觉输入系统",
"speech_coding":"语音编码",
"speech_enhancement":"语音增强",
"speech_recognition":"语音识别",
"speech_synthesis":"语音合成"
};

function displayDataSetResult(page,jsonResult,onlyReturnNum,keyword){
var data = jsonResult.Result;
var total = jsonResult.Total;
@@ -152,6 +195,12 @@ function displayDataSetResult(page,jsonResult,onlyReturnNum,keyword){
html += "<div class=\"item\">";
html += " <div class=\"content\">";
html += " <div class=\"ui right metas\">" ;
if(!isEmpty(recordMap["category"])){
html += " <span class=\"text grey\"><svg class=\"svg octicon-tasklist\" width=\"16\" height=\"16\" aria-hidden=\"true\"><use xlink:href=\"#octicon-tasklist\" /></svg> " +recordMap["category"]+ "</span>";
}
if(!isEmpty(recordMap["task"])){
html += " <span class=\"text grey\"><svg class=\"svg octicon-tag\" width=\"16\" height=\"16\" aria-hidden=\"true\"><use xlink:href=\"#octicon-tag\" /></svg>" +recordMap["task"]+ "</span>";
}
html += " <span class=\"text grey\"><i class=\"ri-fire-line\"></i> " +recordMap["download_times"] + "</span> ";
html +=" </div>";
html += " <div class=\"ui header\">";
@@ -159,8 +208,10 @@ function displayDataSetResult(page,jsonResult,onlyReturnNum,keyword){
html +=" <span class=\"middle\"><svg class=\"svg octicon-repo-clone\" width=\"16\" height=\"16\" aria-hidden=\"true\"><use xlink:href=\"#octicon-repo-clone\"></use></svg></span>";
html +=" </div>";
html += " <div class=\"description\">";
html += " <p class=\"has-emoji\"> " + recordMap["description"] + "</p>";
html += " <p class=\"has-emoji\"> " + recordMap["file_name"] + "</p>";
html += " <p class=\"has-emoji\"> " + recordMap["title"] + "</p>";
if(!isEmpty(recordMap["file_name"])){
html += " <p class=\"has-emoji\"> " + recordMap["file_name"] + "</p>";
}
html +=" <p class=\"time\">";
html +=" <span class=\"am-ml-10\"></span> 最后更新于 <span class=\"time-since poping up\" title=\"\" data-content=\"\" data-variation=\"inverted tiny\">" + getTime(recordMap["created_unix"],currentTime) +"</span>";
html +=" </p>";


+ 1
- 0
routers/search.go View File

@@ -451,6 +451,7 @@ func makeDatasetResult(sRes *elastic.SearchResult, Key string, OnlyReturnNum boo
record["description"] = ""
}
record["file_name"] = recordSource["file_name"]
record["task"] = recordSource["task"]
record["download_times"] = recordSource["download_times"]
record["created_unix"] = recordSource["created_unix"]
result = append(result, record)


Loading…
Cancel
Save