fix(content-drive): global search hides matches without content-type filter (#37211) - #37566
ihoffmann-dot wants to merge 4 commits into
Conversation
Spec approved and merged in #37525. Planning (/speckit-plan, /speckit-tasks) starts here.
|
Claude finished @ihoffmann-dot's task in 2m 47s —— View job Code Review — #37211 content-drive global search scan bound
I reviewed the change against Things I specifically verified:
New Issues
Everything else is sound. The best-effort/load-dependent completeness trade-off is explicitly documented in the Javadoc ( The one carve-out remains the manual large-dataset verification (AC-003/AC-004, tracked as T019) — correctly flagged as out of automated scope in the PR body. No blocking issues. 👍 · branch |
…#37211) getContentByChunks dropped matches silently when no content-type filter narrowed the candidate set: the row-count cutoff (BROWSER_DB_MAX_SCAN_ROWS) could fire before a match further down DB order was ever sent to ES for text narrowing. Bound the ES-filtered path by elapsed time (BROWSER_DB_MAX_SCAN_TIME_MILLIS) instead, so it keeps scanning while still affordable; the permission-only path keeps its original row-count cutoff. Also resolves spec.md's NEEDS CLARIFICATION on the Search All comparison path (ESContentResourcePortlet).
…rive-global-search-filter # Conflicts: # dotCMS/src/main/java/com/dotcms/browser/BrowserAPIImpl.java # dotcms-integration/src/test/java/com/dotcms/browser/BrowserAPITest.java
…iew (#37211) Addresses PR bot review feedback on the ES-narrowed scan time-budget fix: - Add BROWSER_DB_MAX_SCAN_ROWS_ES_HARD_CAP as a co-bound alongside the time budget, so a fast DB/ES pair (or many concurrent unfiltered searches) can't turn the time budget into unbounded per-request work. - Add an integration test that forces the time-cutoff branch itself (not just DB exhaustion) and confirms the returned cursor resumes correctly. - Add an integration test that forces the new row hard cap. - Document that completeness here is best-effort (load-dependent), and that BROWSER_DB_MAX_SCAN_ROWS still clamps the ES path's chunk size even though it no longer bounds the ES scan's total rows. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Summary
PR 2 (implementation) for the issue-resolution spec approved and merged in #37525.
Fixes #37211 — Content Drive's unfiltered global search silently drops matches that the same term finds once a content-type filter is applied, because the DB-order chunked scan (
BrowserAPIImpl.getContentByChunks) terminated on a hard row-count cutoff (BROWSER_DB_MAX_SCAN_ROWS) instead of match coverage, while the legacy Search All portlet (ESContentResourcePortlet, querying ES directly) does not have this gap.Fix: stays DB-first per accepted ADR-0018 (DB drives candidate order/pagination; index only narrows) — the ES-narrowed scan now bounds cost by elapsed time (
BROWSER_DB_MAX_SCAN_TIME_MILLIS, new) instead of row count, so it keeps scanning while still affordable instead of giving up at an arbitrary row count. The permission-only scan path is unchanged (row-count cutoff, no completeness gap to fix).Reconciled with #37395 (already merged to
main), which touches the samegetContentByChunksmethod (chunk-size clamping + exit-order fix) — this branch has been merged withmainto integrate both./speckit-convergereports converged against the current code (0 findings) — seeresearch.md/plan.mdinspecs/37418-content-drive-global/for the full ADR-driven rationale.Test plan
BrowserAPITestcovering: unfiltered global search finding a match past the (lowered, for test purposes) scan limit (AC-001); content-type filter only narrowing, never adding, matches (AC-002); scan-cost regression guard (bounded elapsed time)scanLimitStopsLoop,scanLimitAlignedWithChunkBoundary_doesNotSkipLeftoverItemsfrom fix(content-drive): resolve single-pass-eligible field filters in one scan (#37184) #37395) — all 5 tests green together/speckit-convergerun against final code — converged, 0 findingsquickstart.md. This is the one item/speckit-convergeexplicitly carves out as a sanctioned manual-only exception (no automated harness exists for Search All ↔ Content Drive comparison, and seeding real-world scale in an integration test is impractical) — tracked as task T019 inspecs/37418-content-drive-global/tasks.md. Will follow up once a suitable large dataset/environment is available.🤖 Generated with Claude Code