From dbf1a17a04b4a328122fca21e535e8de9616532d Mon Sep 17 00:00:00 2001 From: felix Date: Thu, 31 Mar 2022 20:03:47 +0800 Subject: [PATCH] =?UTF-8?q?build:=20=E6=9E=84=E5=BB=BA1.3.1=E7=89=88?= =?UTF-8?q?=E6=9C=AC=EF=BC=8C=20=E6=B7=BB=E5=8A=A0=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E6=94=AF=E6=8C=81routing=20=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- easy-es-core/pom.xml | 2 +- .../felix/easy/core/elastic/client/EasyEsService.java | 9 +++++++++ pom.xml | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/easy-es-core/pom.xml b/easy-es-core/pom.xml index 94ebba0..3d19ee7 100644 --- a/easy-es-core/pom.xml +++ b/easy-es-core/pom.xml @@ -5,7 +5,7 @@ easy-es indi.felix.easy - 1.3.0 + 1.3.1 4.0.0 easy-es-core diff --git a/easy-es-core/src/main/java/indi/felix/easy/core/elastic/client/EasyEsService.java b/easy-es-core/src/main/java/indi/felix/easy/core/elastic/client/EasyEsService.java index 3a68fcb..13fa717 100644 --- a/easy-es-core/src/main/java/indi/felix/easy/core/elastic/client/EasyEsService.java +++ b/easy-es-core/src/main/java/indi/felix/easy/core/elastic/client/EasyEsService.java @@ -155,8 +155,17 @@ public class EasyEsService extends AbstractService { } public SearchResponse searchResponse(SearchSourceBuilder builder, String... index) throws IOException { + return searchResponse(builder, null, index); + } + + public SearchResponse searchResponse(SearchSourceBuilder builder, List routing, String... index) throws IOException { SearchRequest request = new SearchRequest(index); request.source(builder); + + if(CollectionUtils.isNotEmpty(routing)){ + request.routing(routing.toArray(new String[0])); + } + SearchResponse response = restHighLevelClient.search(request, RequestOptions.DEFAULT); return response; diff --git a/pom.xml b/pom.xml index 1ecff85..cd844b8 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ indi.felix.easy easy-es pom - 1.3.0 + 1.3.1 easy-es-core -- GitLab