搜索中心

This commit is contained in:
zhn
2023-12-29 15:45:28 +08:00
parent 4b9dbf47d1
commit ed0375ea5a
@@ -377,6 +377,14 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
Map<String,Object> map2 = new HashMap<>();
map2.put("match",map1);
should.add(map2);
for (String s1 : value.split(",")) {
Map<String,Object> map = new HashMap();
map.put(key,"*"+s1+"*");
Map<String,Object> mapTemp = new HashMap<>();
mapTemp.put("wildcard",map);
should.add(mapTemp);
}
}
JSONObject jsonObject = jeroElasticsearchTemplate.buildBoolQuery(null, null, should);
must.add(jsonObject);
@@ -800,10 +808,10 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
// // wildcard模糊查询
// //情况举例:用户只记得中间那段字
// Map<String, Object> map24 = new HashMap<>();
// Map<String, Object> map44 = new HashMap<>();
// Map<String, Object> map55 = new HashMap<>();
// map55.put("value","*" + selectValue + "*");
Map<String, Object> map24 = new HashMap<>();
Map<String, Object> map44 = new HashMap<>();
Map<String, Object> map55 = new HashMap<>();
map55.put("value","*" + selectValue + "*");
// if("serial_number".equals(field)){
// map55.put("boost",10);
// }else if("title".equals(field)){
@@ -815,10 +823,10 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
// }else if("file_name".equals(field)){
// map55.put("boost",5);
// }
//
// map24.put(field, map55);
// map44.put("wildcard",map24);
// queryMapJson.add(map44);
map24.put(field, map55);
map44.put("wildcard",map24);
queryMapJson.add(map44);
}
}
// private void getQueryMapJsonFullText(JSONArray queryMapJson, String selectValue, String field) {