diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/searchcenter/service/impl/LawsMonthlyReportSearchServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/searchcenter/service/impl/LawsMonthlyReportSearchServiceImpl.java index d4fea43f6..179f3e0b5 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/searchcenter/service/impl/LawsMonthlyReportSearchServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/searchcenter/service/impl/LawsMonthlyReportSearchServiceImpl.java @@ -118,6 +118,7 @@ public class LawsMonthlyReportSearchServiceImpl implements ILawsMonthlyReportSea Map map25 = new HashMap<>(); Map map45 = new HashMap<>(); map25.put("query", selectValue); + map25.put("fields", fieldList.toArray()); map25.put("allow_leading_wildcard", false); map45.put("query_string", map25); queryMapJsonTwo.add(map45); @@ -248,9 +249,9 @@ public class LawsMonthlyReportSearchServiceImpl implements ILawsMonthlyReportSea Map map31 = new HashMap<>(); Map map41 = new HashMap<>(); if("title".equals(field)){ - map31.put("boost",1); + map31.put("boost",10); }else if("content".equals(field)){ - map31.put("boost",0.01); + map31.put("boost",2); } map31.put("value", selectValue); map21.put(field + ".keyword", map31); @@ -262,9 +263,9 @@ public class LawsMonthlyReportSearchServiceImpl implements ILawsMonthlyReportSea Map map32 = new HashMap<>(); Map map42 = new HashMap<>(); if("title".equals(field)){ - map32.put("boost",1); + map32.put("boost",10); }else if("content".equals(field)){ - map32.put("boost",0.01); + map32.put("boost",2); } map32.put("query", selectValue); map22.put(field, map32); @@ -274,7 +275,15 @@ public class LawsMonthlyReportSearchServiceImpl implements ILawsMonthlyReportSea // match分词匹配查询 // 情况举例:用户可能他知道开头的前缀几个字,知道中间的几个字 Map map23 = new HashMap<>(); + Map map33 = new HashMap<>(); Map map43 = new HashMap<>(); + if("title".equals(field)){ + map33.put("boost",10); + }else if("content".equals(field)){ + map33.put("boost",2); + } + map33.put("query", selectValue); + map23.put(field, map33); map23.put(field, selectValue); map43.put("match", map23); queryMapJson.add(map43);