注释问题知识库向es插入数据。
This commit is contained in:
+5
-5
@@ -92,7 +92,7 @@ public class ProblemKnowledgeBaseEOServiceImpl extends ServiceImpl<ProblemKnowle
|
|||||||
//如果展示权限是公开,则把该数据插入到搜索中心中。
|
//如果展示权限是公开,则把该数据插入到搜索中心中。
|
||||||
//this.addOrUpdateElasticsearch(problemKnowledgeBaseEO);
|
//this.addOrUpdateElasticsearch(problemKnowledgeBaseEO);
|
||||||
}
|
}
|
||||||
this.addOrUpdateElasticsearch(problemKnowledgeBaseEO);
|
// this.addOrUpdateElasticsearch(problemKnowledgeBaseEO);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -403,7 +403,7 @@ public class ProblemKnowledgeBaseEOServiceImpl extends ServiceImpl<ProblemKnowle
|
|||||||
//this.deleteElasticsearchData(problemKnowledgeBaseEO.getId());
|
//this.deleteElasticsearchData(problemKnowledgeBaseEO.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
this.addOrUpdateElasticsearch(problemKnowledgeBaseEO);
|
// this.addOrUpdateElasticsearch(problemKnowledgeBaseEO);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -439,9 +439,9 @@ public class ProblemKnowledgeBaseEOServiceImpl extends ServiceImpl<ProblemKnowle
|
|||||||
|
|
||||||
this.problemKnowledgeBaseCommentEOService.remove(deleteWrapper);
|
this.problemKnowledgeBaseCommentEOService.remove(deleteWrapper);
|
||||||
|
|
||||||
for (String problemKnowledgeBaseId : ids) {
|
// for (String problemKnowledgeBaseId : ids) {
|
||||||
this.deleteElasticsearchData(problemKnowledgeBaseId);
|
// this.deleteElasticsearchData(problemKnowledgeBaseId);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+9
-9
@@ -436,14 +436,14 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
|
|||||||
JSONArray queryMapJsonAll = new JSONArray();
|
JSONArray queryMapJsonAll = new JSONArray();
|
||||||
|
|
||||||
//基础查询权限,展示权限为公开的,所有人都能查看,展示权限为私密的,只有配置了权限的用户可以查看。
|
//基础查询权限,展示权限为公开的,所有人都能查看,展示权限为私密的,只有配置了权限的用户可以查看。
|
||||||
if("base".equals("base")){
|
/*if("base".equals("base")){
|
||||||
JSONArray queryMapJsonBase = new JSONArray();
|
JSONArray queryMapJsonBase = new JSONArray();
|
||||||
|
|
||||||
this.createQueryWhere(ShowPermissionsEnum.OPEN.getValue(),"show_permissions",queryMapJsonBase,SearchEnum.FULL_TEXT_SEARCH.getValue());
|
this.createQueryWhere(ShowPermissionsEnum.OPEN.getValue(),"show_permissions",queryMapJsonBase,SearchEnum.FULL_TEXT_SEARCH.getValue());
|
||||||
|
|
||||||
JSONObject jsonObject = jeroElasticsearchTemplate.buildBoolQuery(null, null, queryMapJsonBase);
|
JSONObject jsonObject = jeroElasticsearchTemplate.buildBoolQuery(null, null, queryMapJsonBase);
|
||||||
queryMapJsonAll.add(jsonObject);
|
queryMapJsonAll.add(jsonObject);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
Map<String,Object> mapHighlight = new HashMap<>();
|
Map<String,Object> mapHighlight = new HashMap<>();
|
||||||
Map<String,Object> mapHighlight1 = new HashMap<>();
|
Map<String,Object> mapHighlight1 = new HashMap<>();
|
||||||
@@ -547,20 +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<>();
|
||||||
|
Map<String,Object> score1 = new HashMap<>();
|
||||||
|
score.put("order","desc");
|
||||||
|
score1.put("_score",score);
|
||||||
|
sort.putAll(score1);
|
||||||
|
/*JSONObject sort = new JSONObject();
|
||||||
if(StringUtils.isEmpty(selectValue)){
|
if(StringUtils.isEmpty(selectValue)){
|
||||||
Map<String,Object> createTime = new HashMap<>();
|
Map<String,Object> createTime = new HashMap<>();
|
||||||
Map<String,Object> createTime1 = new HashMap<>();
|
Map<String,Object> createTime1 = new HashMap<>();
|
||||||
createTime.put("order","desc");
|
createTime.put("order","desc");
|
||||||
createTime1.put("create_time",createTime);
|
createTime1.put("create_time",createTime);
|
||||||
sort.putAll(createTime1);
|
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<>();
|
||||||
|
|||||||
Reference in New Issue
Block a user