bug(opensearch): OS search path ignores ES_TRACK_TOTAL_HITS (wrong total count) in phase 3
@fabrizzio-dotCMS is already working on this.
Since Jun 25, 2026.
- Dominant language
- Java
- Stars
- 970
- Forks
- 486
- Avg merge
- 3d 33m
- Merged PRs (30d)
- 170
Description
Problem Statement
Under ES→OS migration phase 3 (OpenSearch-only), the OpenSearch search/count path does not honor ES_TRACK_TOTAL_HITS the way the ElasticSearch path does, so the total-hit count is wrong:
ESContentFactoryImplTest.Test_TrackHits_SearchCount <<< FAILURE!
java.lang.AssertionError: expected:<60> but was:<30>
The test toggles ES_TRACK_TOTAL_HITS (set to 80, then null) and asserts the returned total count; under OS the count is capped/different (30 vs the expected 60), indicating the OS search path ignores or mis-applies the track-total-hits setting.
Steps to Reproduce
./mvnw verify -pl :dotcms-integration -Dcoreit.test.skip=false \
-Dopensearch.phase=3 \
-Dit.test=ESContentFactoryImplTest
Test_TrackHits_SearchCount fails with expected:<60> but was:<30>.
Acceptance Criteria
- The OS search/count path applies
ES_TRACK_TOTAL_HITSwith the same semantics as the ES path. -
ESContentFactoryImplTest.Test_TrackHits_SearchCountpasses under phase 3. - No regression in phase 0 (ES) behavior.
dotCMS Version
main (dev / 1.0.0-SNAPSHOT) — ES→OS migration work.
Severity
Medium
Links
Found via blast-radius experiment in PR #36268 / issue #36266. Related test-decoupling: #36320.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.