fix(os-search): honor track_total_hits and _score sort on the OpenSearch read path (#36501)#36557
Open
fabrizzio-dotCMS wants to merge 1 commit into
Open
fix(os-search): honor track_total_hits and _score sort on the OpenSearch read path (#36501)#36557fabrizzio-dotCMS wants to merge 1 commit into
fabrizzio-dotCMS wants to merge 1 commit into
Conversation
…rch read path (#36501) Two OS read-path gaps surfaced running the integration suite under migration phase 2 (reads from OpenSearch); both have a working ES reference implementation. - track_total_hits: OSIndexProperty.TRACK_TOTAL_HITS had no ES fallback key, so an existing ES_TRACK_TOTAL_HITS configuration was ignored under OS reads and OS always reported the full accurate count. Add the "ES_TRACK_TOTAL_HITS" fallback, matching the dual-key pattern used by USE_FILTERS_FOR_SEARCHING. (Fixes ESContentFactoryImplTest .Test_TrackHits_SearchCount under phase 2 — a gap tracked in #36320.) - _score sort: ContentFactoryIndexOperationsOS.addSorting, for sortBy=score, added only the secondary field sort and never a primary _score sort, so results were ordered by moddate and hit[0] was not the highest-scoring document. Add the _score DESC primary sort before the secondary field, mirroring ContentFactoryIndexOperationsES.addSorting. (Fixes ESContentFactoryImplTest.testScore under phase 2.) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
3 tasks
Contributor
|
Claude finished @fabrizzio-dotCMS's task in 2m 20s —— View job Rollback-Safety Analysis — PR #36557
Verdict: ✅ Safe to rollback — label Why: Both changes are pure query-construction logic evaluated at search time, not storage/schema/mapping changes:
No category in the reference doc applies: no |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
Two OpenSearch read-path gaps found running the integration suite under ES→OS migration phase 2 (reads from OpenSearch). Both have a working ES reference implementation. Contributes to #36501.
OSIndexProperty.TRACK_TOTAL_HITShad no ES fallback key, so an existingES_TRACK_TOTAL_HITSconfig was ignored under OS reads and OS always returned the full accurate count. Added theES_TRACK_TOTAL_HITSfallback (same dual-key pattern asUSE_FILTERS_FOR_SEARCHING).ContentFactoryIndexOperationsOS.addSorting, forsortBy=score, added only the secondary field sort and never a primary_scoresort, so results ordered by moddate and hit[0] was not the highest-scoring doc. Added the_score DESCprimary sort (mirrorsContentFactoryIndexOperationsES.addSorting; API matchesOSContentletScrollImpl).Verification
Phase 2, isolated env:
ESContentFactoryImplTest42/0/0 (incl.Test_TrackHits_SearchCountandtestScore, previously failing). Core compiles.Refs #36501, #36320.