dotCMS / dotCMS/core

bug(opensearch): OS search path ignores ES_TRACK_TOTAL_HITS (wrong total count) in phase 3

Open
#36,325 0 comments 0 reactions 1 assignee View on GitHub

@fabrizzio-dotCMS is already working on this.

Since Jun 25, 2026.

Team : Scout
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_HITS with the same semantics as the ES path.
  • ESContentFactoryImplTest.Test_TrackHits_SearchCount passes 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.