mirror of
https://gitee.com/dromara/easy-es.git
synced 2025-12-06 17:18:57 +08:00
update easy-es-core/src/main/java/cn/easyes/core/conditions/WrapperProcessor.java.
Signed-off-by: 吴凯雄 <542538987@qq.com>
This commit is contained in:
parent
ef7732f303
commit
079a503c24
@ -222,12 +222,9 @@ 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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user