When the actual number of search results differs from the number of hits for a query, fastQuerySize option may be set as enabled (true).
There are multiple ways to enable the fastQuerySize option. This article explains how to configure each way.
OSGi Configuration:Web Console > Configuration > Apache Jackrabbit Query Engine Settings Service > Fast result size
http://localhost:4502/system/console/configMgr/org.apache.jackrabbit.oak.query.QueryEngineSettingsService
Check “Fast result size” and Save.
Java configuration:-Doak.fastQuerySize=true
Add the system property below in your AEM start script(crx-quickstart/bin/start).
CQ_JVM_OPTS=“${CQ_JVM_OPTS} -Doak.fastQuerySize=true”
This configuration overrides OSGi configuration.
JMX:Web Console > JMX > org.apache.jackrabbit.oak: settings (QueryEngineSettings)
http://localhost:4502/system/console/jmx/org.apache.jackrabbit.oak%3Aname%3Dsettings%2Ctype%3DQueryEngineSettings
Change “Fast result size” to true and Save.
This configuration value at JMX overrides other configurations. Restarting AEM resets the value.