搜索中心-法规月报-查询优化
This commit is contained in:
+2
-2
@@ -8,8 +8,8 @@ package com.jero.modules.document.enums;
|
||||
public enum SearchEnum {
|
||||
INDEX_NAME_DOCUMENT("文档库索引名称","documentLibrary"),
|
||||
TYPE_NAME_DOCUMENT("文档库类型","document"),
|
||||
INDEX_NAME_LAWS_MONTHLY_REPORT("法规月报索引名称","lawsMonthlyReportManage"),
|
||||
TYPE_NAME_LAWS_MONTHLY_REPORT("法规月报类型名称","lawsMonthlyReport"),
|
||||
INDEX_NAME_LAWS_MONTHLY_REPORT("法规月报索引名称","lawsmonthlyreportmanage"),
|
||||
TYPE_NAME_LAWS_MONTHLY_REPORT("法规月报类型名称","lawsmonthlyreport"),
|
||||
FULL_TEXT_SEARCH("全部中文","fulltextsearchcn"),
|
||||
FULL_TEXT_SEARCH_CN("全部中文","fulltextsearchcn"),
|
||||
FULL_TEXT_SEARCH_EN("全部英文","fulltextsearchen"),
|
||||
|
||||
+7
-8
@@ -191,20 +191,20 @@ public class LawsMonthlyReportManageEOServiceImpl extends ServiceImpl<LawsMonthl
|
||||
List<Map<String, Object>> mapListTempEn = new ArrayList<>();
|
||||
//文件相关封装中文的全文内容(es) 非搜索条件下的:flag---SEARCH_FLAG
|
||||
putMap(id, "法规月报",
|
||||
fileText, monthlyReportManageEO.getName(), fileText,
|
||||
fileText, monthlyReportManageEO.getName(),
|
||||
ossFile.getFileName(), ossFile.getId(), issueTime, CutEnum.CN.getValue(), stringMapCn, SEARCH_FLAG);
|
||||
//文件相关封装英文的全文内容(es) 搜索条件下的: flag---null
|
||||
//文件相关封装英文的全文内容(es)
|
||||
putMap(id, "monthly report",
|
||||
fileText, monthlyReportManageEO.getName(), fileText,
|
||||
fileText, monthlyReportManageEO.getName(),
|
||||
ossFile.getFileName(), ossFile.getId(), issueTime, CutEnum.EN.getValue(), stringMapEn, SEARCH_FLAG);
|
||||
|
||||
//文件相关封装中文的全文内容(es)
|
||||
//文件相关封装中文的全文内容(es) 搜索条件下的: flag---null
|
||||
putMap(id + monthlyReportManageEO.getFileId(), "法规月报",
|
||||
fileText, monthlyReportManageEO.getName(), fileText,
|
||||
fileText, monthlyReportManageEO.getName(),
|
||||
ossFile.getFileName(), ossFile.getId(), issueTime, CutEnum.CN.getValue(), stringMapCnForSearch, null);
|
||||
//文件相关封装英文的全文内容(es)
|
||||
putMap(id + monthlyReportManageEO.getFileId(), "monthly report",
|
||||
fileText, monthlyReportManageEO.getName(), fileText,
|
||||
fileText, monthlyReportManageEO.getName(),
|
||||
ossFile.getFileName(), ossFile.getId(), issueTime, CutEnum.EN.getValue(), stringMapEnForSearch, null);
|
||||
|
||||
mapListTempCn.add(stringMapCn);
|
||||
@@ -247,7 +247,7 @@ public class LawsMonthlyReportManageEOServiceImpl extends ServiceImpl<LawsMonthl
|
||||
}
|
||||
}
|
||||
private void putMap(String id, String moduleType,
|
||||
String content, String title , String fileText,
|
||||
String content, String title ,
|
||||
String fileName, String fileId, Date issueTime, String cut,
|
||||
Map<String, Object> stringMap,
|
||||
String flag){
|
||||
@@ -256,7 +256,6 @@ public class LawsMonthlyReportManageEOServiceImpl extends ServiceImpl<LawsMonthl
|
||||
stringMap.put("module_type_flag", ModuleTypeFlagEnum.LAWS_MONTHLY_REPORT.getValue()); // 默认法规月报标识
|
||||
stringMap.put("content", content);
|
||||
stringMap.put("title", title);
|
||||
stringMap.put("file_text", fileText);
|
||||
stringMap.put("file_name", fileName);
|
||||
stringMap.put("file_id", fileId);
|
||||
stringMap.put("create_time", issueTime);
|
||||
|
||||
+2
-1
@@ -89,6 +89,7 @@ public class LawsMonthlyReportSearchServiceImpl implements ILawsMonthlyReportSea
|
||||
Map<String, Object> map25 = new HashMap<>();
|
||||
Map<String, Object> map45 = new HashMap<>();
|
||||
map25.put("query", selectValue);
|
||||
map25.put("fields", fieldList.toArray());
|
||||
map25.put("allow_leading_wildcard", false); //禁用了前置通配符
|
||||
map45.put("query_string", map25);
|
||||
queryMapJson.add(map45);
|
||||
@@ -234,7 +235,7 @@ public class LawsMonthlyReportSearchServiceImpl implements ILawsMonthlyReportSea
|
||||
list1.add("</text>");
|
||||
mapTemp.put("pre_tags", list);
|
||||
mapTemp.put("post_tags", list1);
|
||||
mapTemp.put("fragment_size", 450);//高亮字段内容长度,去除html样式标签,统计字数,设置为200
|
||||
mapTemp.put("fragment_size", 500);//高亮字段内容长度,去除html样式标签,统计字数,设置为200
|
||||
mapTemp.put("number_of_fragments", 1);//高亮内容默认分为5段, 此处设置为一段
|
||||
mapTemp.put("type", "plain");
|
||||
mapHighlight.put(key, mapTemp);
|
||||
|
||||
Reference in New Issue
Block a user