文档库--列表中选中数据后再结果中搜索
This commit is contained in:
+24
-4
@@ -488,7 +488,7 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
|
||||
}
|
||||
Integer pageNo = searchVO.getPage();
|
||||
Integer pageSize = searchVO.getPageSize();
|
||||
IPage page = getiPage(selectValue, selectValueTwo, queryMapJson, pageNo, pageSize);
|
||||
IPage page = getiPage(selectValue, selectValueTwo, queryMapJson,null, pageNo, pageSize,null);
|
||||
|
||||
|
||||
return page;
|
||||
@@ -496,9 +496,14 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private IPage getiPage(String selectValue, String selectValueTwo, JSONArray queryMapJson, Integer pageNo, Integer pageSize) {
|
||||
private IPage getiPage(String selectValue, String selectValueTwo, JSONArray queryMapJson,JSONArray should, Integer pageNo, Integer pageSize,String paragraphFlag) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
//基础添加封装
|
||||
JSONObject jsonObject = jeroElasticsearchTemplate.buildBoolQuery(null, null, queryMapJson);
|
||||
if("paragraphFlag".equals(paragraphFlag)){
|
||||
jsonObject = jeroElasticsearchTemplate.buildBoolQuery(queryMapJson, null, should);
|
||||
}else{
|
||||
jsonObject = jeroElasticsearchTemplate.buildBoolQuery(null, null, queryMapJson);
|
||||
}
|
||||
//全部
|
||||
//1. 条件,分页
|
||||
JSONObject queryObject = jeroElasticsearchTemplate.buildQuery(null,
|
||||
@@ -752,6 +757,19 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
|
||||
if(ObjectUtils.isNotEmpty(mapTwo)){
|
||||
queryCondition(mapTwo, inputFieldList, otherFieldList, must);
|
||||
}
|
||||
//处理ids
|
||||
JSONArray should = new JSONArray();
|
||||
String ids = (String) mapTwo.get("ids");
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
for (String s : ids.split(",")) {
|
||||
Map<String, Object> queryMap = new HashMap<>();
|
||||
Map<String, Object> queryMapTemp = new HashMap<>();
|
||||
queryMapTemp.put("id", s);
|
||||
queryMap.put("match", queryMapTemp);
|
||||
should.add(queryMap);
|
||||
}
|
||||
}
|
||||
|
||||
int pageNo = Integer.parseInt(map.get("pageNo").toString());
|
||||
int pageSize = Integer.parseInt(map.get("pageSize").toString());
|
||||
//判断第一次传参和第二次传参 inputFieldList
|
||||
@@ -771,9 +789,11 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
|
||||
selectValueTwo = value;
|
||||
}
|
||||
}
|
||||
//段落的标识
|
||||
String paragraphFlag = "paragraphFlag";
|
||||
|
||||
|
||||
IPage iPage = getiPage(selectValue, selectValueTwo, must, pageNo, pageSize);
|
||||
IPage iPage = getiPage(selectValue, selectValueTwo, must,should, pageNo, pageSize,paragraphFlag);
|
||||
return iPage;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user