搜索中心-问题知识库-排序优化
This commit is contained in:
+10
-3
@@ -1532,7 +1532,7 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
|
|||||||
Map<String, Object> map31 = new HashMap<>();
|
Map<String, Object> map31 = new HashMap<>();
|
||||||
Map<String, Object> map41 = new HashMap<>();
|
Map<String, Object> map41 = new HashMap<>();
|
||||||
if("title".equals(field)){
|
if("title".equals(field)){
|
||||||
map31.put("boost",1);
|
map31.put("boost",10);
|
||||||
}else if("content".equals(field)){
|
}else if("content".equals(field)){
|
||||||
map31.put("boost",0.01);
|
map31.put("boost",0.01);
|
||||||
}
|
}
|
||||||
@@ -1546,7 +1546,7 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
|
|||||||
Map<String, Object> map32 = new HashMap<>();
|
Map<String, Object> map32 = new HashMap<>();
|
||||||
Map<String, Object> map42 = new HashMap<>();
|
Map<String, Object> map42 = new HashMap<>();
|
||||||
if("title".equals(field)){
|
if("title".equals(field)){
|
||||||
map32.put("boost",1);
|
map32.put("boost",10);
|
||||||
}else if("content".equals(field)){
|
}else if("content".equals(field)){
|
||||||
map32.put("boost",0.01);
|
map32.put("boost",0.01);
|
||||||
}
|
}
|
||||||
@@ -1558,8 +1558,15 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
|
|||||||
// match分词匹配查询
|
// match分词匹配查询
|
||||||
// 情况举例:用户可能他知道开头的前缀几个字,知道中间的几个字
|
// 情况举例:用户可能他知道开头的前缀几个字,知道中间的几个字
|
||||||
Map<String, Object> map23 = new HashMap<>();
|
Map<String, Object> map23 = new HashMap<>();
|
||||||
|
Map<String, Object> map33 = new HashMap<>();
|
||||||
Map<String, Object> map43 = new HashMap<>();
|
Map<String, Object> map43 = new HashMap<>();
|
||||||
map23.put(field, selectValue);
|
if("title".equals(field)){
|
||||||
|
map33.put("boost",10);
|
||||||
|
}else if("content".equals(field)){
|
||||||
|
map33.put("boost",0.01);
|
||||||
|
}
|
||||||
|
map33.put("query", selectValue);
|
||||||
|
map23.put(field, map33);
|
||||||
map43.put("match", map23);
|
map43.put("match", map23);
|
||||||
queryMapJson.add(map43);
|
queryMapJson.add(map43);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user