未排单查询更改

This commit is contained in:
liuzhaotian
2025-01-15 12:24:49 +08:00
parent 14fdac7ea8
commit 834784c7d4
11 changed files with 131 additions and 55 deletions
@@ -84,7 +84,7 @@ public interface ESDocumentService {
* @param tClass 返回的类型
* @param map 修改内容的map
*/
<T> Result updateById(String idxName, String docId, Class<T> tClass, Map<String,Object> map) throws IOException;
<T> Result updateById(String idxName, String docId, Class<T> tClass, Map<String,Object> map) throws IOException, ElasticsearchException;
/**
* 根据文档id查找文档,返回类型是ObjectNode
@@ -196,7 +196,7 @@ public class ESDocumentServiceImpl implements ESDocumentService {
* 把年龄改成35
*/
@Override
public <T> Result updateById(String idxName, String docId, Class<T> tClass, Map<String, Object> map) throws IOException {
public <T> Result updateById(String idxName, String docId, Class<T> tClass, Map<String, Object> map) throws IOException, ElasticsearchException {
UpdateResponse<T> response = elasticsearchClient.update(e -> e.index(idxName).id(docId).doc(map), tClass);
return response.result();
}