搜索中心-问题知识库查询。

This commit is contained in:
wangzhijiang
2022-08-26 18:03:21 +08:00
parent ed2fba66c0
commit 2935b3f302
@@ -1184,6 +1184,15 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
//高亮
if(!"flag".equals(field)){
problemKnowledgeBaseHighlight(mapHighlight, field);
}else {
// query_string查询
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);
}
}
mapHighlight1.put("fields",mapHighlight);
@@ -1440,7 +1449,7 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
list1.add("</text>");
mapTemp.put("pre_tags", list);
mapTemp.put("post_tags", list1);
mapTemp.put("fragment_size", 550);//高亮字段内容长度,去除html样式标签,统计字数,设置为200
mapTemp.put("fragment_size", 280);//高亮字段内容长度,去除html样式标签,统计字数,设置为200
mapTemp.put("number_of_fragments", 1);//高亮内容默认分为5段, 此处设置为一段
mapTemp.put("type", "plain");
mapHighlight.put(key, mapTemp);