搜索中心修改
This commit is contained in:
+16
-8
@@ -344,14 +344,22 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
|
|||||||
for (Map.Entry<String, Object> entry : otherMap.entrySet()) {
|
for (Map.Entry<String, Object> entry : otherMap.entrySet()) {
|
||||||
String key = entry.getKey();
|
String key = entry.getKey();
|
||||||
String value = (String) entry.getValue();
|
String value = (String) entry.getValue();
|
||||||
if (ObjectUtils.isNotEmpty(value)) {
|
Map<String, Object> map = new HashMap<>();
|
||||||
Map<String, Object> queryMap = new HashMap<>();
|
Map<String, Object> queryMap = new HashMap<>();
|
||||||
Map<String, Object> queryMapTemp = new HashMap<>();
|
Map<String, Object> queryMapTemp = new HashMap<>();
|
||||||
queryMapTemp.put(key, "*"+value.replaceAll(",","*")+"*");
|
queryMapTemp.put("query", value);
|
||||||
// queryMapTemp.put(key, "*"+value+"*");
|
// queryMapTemp.put("minimum_should_match", 2);
|
||||||
queryMap.put("wildcard", queryMapTemp);
|
queryMap.put(key, queryMapTemp);
|
||||||
must.add(queryMap);
|
map.put("match",queryMap);
|
||||||
}
|
must.add(map);
|
||||||
|
// if (ObjectUtils.isNotEmpty(value)) {
|
||||||
|
// Map<String, Object> queryMap = new HashMap<>();
|
||||||
|
// Map<String, Object> queryMapTemp = new HashMap<>();
|
||||||
|
// queryMapTemp.put(key, "*"+value.replaceAll(",","*")+"*");
|
||||||
|
//// queryMapTemp.put(key, "*"+value+"*");
|
||||||
|
// queryMap.put("wildcard", queryMapTemp);
|
||||||
|
// must.add(queryMap);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//封装时间类型字段查询(时间范围)
|
//封装时间类型字段查询(时间范围)
|
||||||
|
|||||||
Reference in New Issue
Block a user