Merge remote-tracking branch 'origin/dev_third_stage' into dev_third_stage
This commit is contained in:
+1
-1
@@ -380,7 +380,7 @@ public class ProblemKnowledgeBaseEOServiceImpl extends ServiceImpl<ProblemKnowle
|
|||||||
convertAfterMap.put("stand_number",problemKnowledgeBaseEO.getStandNumber());
|
convertAfterMap.put("stand_number",problemKnowledgeBaseEO.getStandNumber());
|
||||||
convertAfterMap.put("standard_title",problemKnowledgeBaseEO.getStandTitle());
|
convertAfterMap.put("standard_title",problemKnowledgeBaseEO.getStandTitle());
|
||||||
convertAfterMap.put("content",problemKnowledgeBaseEO.getContent());
|
convertAfterMap.put("content",problemKnowledgeBaseEO.getContent());
|
||||||
convertAfterMap.put("createTime",problemKnowledgeBaseEO.getCreateTime());
|
convertAfterMap.put("create_time",new Date());
|
||||||
convertAfterMap.put("show_permissions",problemKnowledgeBaseEO.getShowPermissions());
|
convertAfterMap.put("show_permissions",problemKnowledgeBaseEO.getShowPermissions());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+43
-14
@@ -547,12 +547,20 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
|
|||||||
JSONObject jsonObjectThree = jeroElasticsearchTemplate.buildBoolQuery(null, null, queryMapJsonThree);
|
JSONObject jsonObjectThree = jeroElasticsearchTemplate.buildBoolQuery(null, null, queryMapJsonThree);
|
||||||
queryMapJsonAll.add(jsonObjectThree);
|
queryMapJsonAll.add(jsonObjectThree);
|
||||||
}
|
}
|
||||||
|
// JSONObject sort = new JSONObject();
|
||||||
|
// Map<String,Object> score = new HashMap<>();
|
||||||
|
// Map<String,Object> score1 = new HashMap<>();
|
||||||
|
// score.put("order","desc");
|
||||||
|
// score1.put("_score",score);
|
||||||
|
// sort.putAll(score1);
|
||||||
JSONObject sort = new JSONObject();
|
JSONObject sort = new JSONObject();
|
||||||
Map<String,Object> score = new HashMap<>();
|
if(StringUtils.isEmpty(selectValue)){
|
||||||
Map<String,Object> score1 = new HashMap<>();
|
Map<String,Object> createTime = new HashMap<>();
|
||||||
score.put("order","desc");
|
Map<String,Object> createTime1 = new HashMap<>();
|
||||||
score1.put("_score",score);
|
createTime.put("order","desc");
|
||||||
sort.putAll(score1);
|
createTime1.put("create_time",createTime);
|
||||||
|
sort.putAll(createTime1);
|
||||||
|
}
|
||||||
|
|
||||||
// Map<String,Object> mapSort = new HashMap<>();
|
// Map<String,Object> mapSort = new HashMap<>();
|
||||||
// Map<String,Object> mapSortTemp = new HashMap<>();
|
// Map<String,Object> mapSortTemp = new HashMap<>();
|
||||||
@@ -1152,10 +1160,10 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
|
|||||||
Map<String, Object> map4 = new HashMap<>();
|
Map<String, Object> map4 = new HashMap<>();
|
||||||
if("title".equals(field)){
|
if("title".equals(field)){
|
||||||
map3.put("boost",1);
|
map3.put("boost",1);
|
||||||
}else if("file_text".equals(field)){
|
|
||||||
map3.put("boost",0.01);
|
|
||||||
}else if("content".equals(field)){
|
}else if("content".equals(field)){
|
||||||
map3.put("boost",0.01);
|
map3.put("boost",0.01);
|
||||||
|
}else if("file_text".equals(field)){
|
||||||
|
map3.put("boost",0.01);
|
||||||
}
|
}
|
||||||
//特殊处理标题字段
|
//特殊处理标题字段
|
||||||
if (field.equals("title")){
|
if (field.equals("title")){
|
||||||
@@ -1172,7 +1180,7 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
|
|||||||
|
|
||||||
//高亮
|
//高亮
|
||||||
if(!"flag".equals(field)){
|
if(!"flag".equals(field)){
|
||||||
highlight(mapHighlight, field);
|
problemKnowledgeBaseHighlight(mapHighlight, field);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mapHighlight1.put("fields",mapHighlight);
|
mapHighlight1.put("fields",mapHighlight);
|
||||||
@@ -1219,7 +1227,7 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
|
|||||||
queryMapJsonTwo.add(queryMap);
|
queryMapJsonTwo.add(queryMap);
|
||||||
//高亮
|
//高亮
|
||||||
if(!"flag".equals(field)){
|
if(!"flag".equals(field)){
|
||||||
highlight(mapHighlight, field);
|
problemKnowledgeBaseHighlight(mapHighlight, field);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mapHighlight1.put("fields",mapHighlight);
|
mapHighlight1.put("fields",mapHighlight);
|
||||||
@@ -1244,11 +1252,13 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
|
|||||||
queryMapJsonAll.add(jsonObjectThree);
|
queryMapJsonAll.add(jsonObjectThree);
|
||||||
}
|
}
|
||||||
JSONObject sort = new JSONObject();
|
JSONObject sort = new JSONObject();
|
||||||
Map<String,Object> createTime = new HashMap<>();
|
if(StringUtils.isEmpty(selectValue)){
|
||||||
Map<String,Object> createTime1 = new HashMap<>();
|
Map<String,Object> createTime = new HashMap<>();
|
||||||
createTime.put("order","desc");
|
Map<String,Object> createTime1 = new HashMap<>();
|
||||||
createTime1.put("createTime",createTime);
|
createTime.put("order","desc");
|
||||||
sort.putAll(createTime1);
|
createTime1.put("create_time",createTime);
|
||||||
|
sort.putAll(createTime1);
|
||||||
|
}
|
||||||
|
|
||||||
Integer pageNo = Integer.parseInt(map.get("pageNo").toString());
|
Integer pageNo = Integer.parseInt(map.get("pageNo").toString());
|
||||||
Integer pageSize = Integer.parseInt(map.get("pageSize").toString());
|
Integer pageSize = Integer.parseInt(map.get("pageSize").toString());
|
||||||
@@ -1402,6 +1412,25 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 问题知识库高亮设置
|
||||||
|
* @param mapHighlight
|
||||||
|
* @param key
|
||||||
|
*/
|
||||||
|
private void problemKnowledgeBaseHighlight(Map<String, Object> mapHighlight, String key) {
|
||||||
|
Map<String, Object> mapTemp = new HashMap<>();
|
||||||
|
List<String> list = new ArrayList<>();
|
||||||
|
list.add("<text class='highlight-class'>");
|
||||||
|
List<String> list1 = new ArrayList<>();
|
||||||
|
list1.add("</text>");
|
||||||
|
mapTemp.put("pre_tags", list);
|
||||||
|
mapTemp.put("post_tags", list1);
|
||||||
|
mapTemp.put("fragment_size", 550);//高亮字段内容长度,去除html样式标签,统计字数,设置为200
|
||||||
|
mapTemp.put("number_of_fragments", 1);//高亮内容默认分为5段, 此处设置为一段
|
||||||
|
mapTemp.put("type", "plain");
|
||||||
|
mapHighlight.put(key, mapTemp);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -769,7 +769,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.text-select {
|
.text-select {
|
||||||
flex: 1;
|
width: calc(100% - 126px);
|
||||||
|
height: 38px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
<span class="text-sel" :title="$t('problemClassification')">{{$t('problemClassification')}}</span>
|
<span class="text-sel" :title="$t('problemClassification')">{{$t('problemClassification')}}</span>
|
||||||
<a-select :placeholder="$t('PleaseSelect')+$t('problemClassification')"
|
<a-select :placeholder="$t('PleaseSelect')+$t('problemClassification')"
|
||||||
class="text-select"
|
class="text-select"
|
||||||
|
:getPopupContainer="triggerNode=> triggerNode.parentNode"
|
||||||
allowClear
|
allowClear
|
||||||
v-model="queryParamOne.problem_type">
|
v-model="queryParamOne.problem_type">
|
||||||
<a-select-option v-for="(item, key) in tagList"
|
<a-select-option v-for="(item, key) in tagList"
|
||||||
@@ -318,7 +319,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin-bottom: 24px;
|
margin-bottom: 24px;
|
||||||
line-height: 32px;
|
line-height: 38px;
|
||||||
|
|
||||||
.text-sel {
|
.text-sel {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
@@ -333,7 +334,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.text-select {
|
.text-select {
|
||||||
flex: 1;
|
width: calc(100% - 79px);
|
||||||
height: 38px;
|
height: 38px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -499,9 +500,9 @@
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.selectText {
|
.selectText {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|||||||
Reference in New Issue
Block a user