搜索中心

This commit is contained in:
zhn
2023-12-28 10:22:23 +08:00
parent 1f772c1496
commit 45fc7e9b5e
@@ -388,7 +388,7 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
String key = entry.getKey();
String value = (String) entry.getValue();
if(StringUtils.isNotBlank(value)){
if("technology_territory".equals(key) && ObjectUtils.isNotEmpty(value)){
if(("technology_territory".equals(key) || "standard_system".equals(key)) && ObjectUtils.isNotEmpty(value)){
JSONArray should = new JSONArray();
List<Map<String,Object>> mapList = new ArrayList<>();
@@ -401,31 +401,7 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
}
JSONObject jsonObject = jeroElasticsearchTemplate.buildBoolQuery(null, null, should);
must.add(jsonObject);
}else if("standard_system".equals(key) && ObjectUtils.isNotEmpty(value)){
JSONArray should = new JSONArray();
for (String s : value.split(",")) {
Map<String,Object> map = new HashMap();
map.put("query",s);
Map<String,Object> map1 = new HashMap<>();
map1.put(key,map);
Map<String,Object> map2 = new HashMap<>();
map2.put("match",map1);
should.add(map2);
}
// for (String s : value.split(",")) {
// Map<String,Object> map = new HashMap();
// map.put(key,"*"+s+"*");
// Map<String,Object> map1 = new HashMap<>();
// map1.put("wildcard",map);
// should.add(map1);
// }
JSONObject jsonObject = jeroElasticsearchTemplate.buildBoolQuery(null, null, should);
must.add(jsonObject);
}else{
} else{
Map<String, Object> map = new HashMap<>();
Map<String, Object> queryMap = new HashMap<>();
Map<String, Object> queryMapTemp = new HashMap<>();