搜索中心-法规月报-排序优化
This commit is contained in:
+13
-4
@@ -118,6 +118,7 @@ public class LawsMonthlyReportSearchServiceImpl implements ILawsMonthlyReportSea
|
||||
Map<String, Object> map25 = new HashMap<>();
|
||||
Map<String, Object> 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<String, Object> map31 = new HashMap<>();
|
||||
Map<String, Object> 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<String, Object> map32 = new HashMap<>();
|
||||
Map<String, Object> 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<String, Object> map23 = new HashMap<>();
|
||||
Map<String, Object> map33 = new HashMap<>();
|
||||
Map<String, Object> 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);
|
||||
|
||||
Reference in New Issue
Block a user