From d03732764e8a5c9eaa715c81ec0ff0c7a16c7273 Mon Sep 17 00:00:00 2001 From: ocshawn Date: Tue, 18 Apr 2023 11:15:25 -0500 Subject: [PATCH] fix/countSpeed: speed up _totalCount by not pulling data only total --- src/server/es/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/es/index.js b/src/server/es/index.js index 122361dc..a82b1e2d 100644 --- a/src/server/es/index.js +++ b/src/server/es/index.js @@ -424,7 +424,7 @@ class ES { async getCount(esIndex, esType, filter) { const result = await this.filterData( { esInstance: this, esIndex, esType }, - { filter, fields: false }, + { filter, fields: false, size: 0}, ); return result.hits.total; }