From 079a503c2418c94e0476202fa1f55d00a335d5a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=87=AF=E9=9B=84?= <542538987@qq.com> Date: Fri, 16 Dec 2022 09:54:53 +0000 Subject: [PATCH] update easy-es-core/src/main/java/cn/easyes/core/conditions/WrapperProcessor.java. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴凯雄 <542538987@qq.com> --- .../cn/easyes/core/conditions/WrapperProcessor.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/easy-es-core/src/main/java/cn/easyes/core/conditions/WrapperProcessor.java b/easy-es-core/src/main/java/cn/easyes/core/conditions/WrapperProcessor.java index 21dd8db0..40e84bdd 100644 --- a/easy-es-core/src/main/java/cn/easyes/core/conditions/WrapperProcessor.java +++ b/easy-es-core/src/main/java/cn/easyes/core/conditions/WrapperProcessor.java @@ -222,14 +222,11 @@ public class WrapperProcessor { Optional.ofNullable(wrapper.from).ifPresent(searchSourceBuilder::from); MyOptional.ofNullable(wrapper.size).ifPresent(searchSourceBuilder::size, DEFAULT_SIZE); - if (searchSourceBuilder.size() > DEFAULT_SIZE) { - // 查询超过一万条, trackTotalHists自动开启 - searchSourceBuilder.trackTotalHits(true); - } else { - // 根据全局配置决定是否开启 - searchSourceBuilder.trackTotalHits(GlobalConfigCache.getGlobalConfig().getDbConfig().isEnableTrackTotalHits()); + // 根据全局配置决定是否开启 + if (GlobalConfigCache.getGlobalConfig().getDbConfig().isEnableTrackTotalHits()) { + searchSourceBuilder.trackTotalHits(Boolean.TRUE); } - + return searchSourceBuilder; }