Skip to content

[BUG] Content Drive: keyword/title search returns inconsistent or incoherent results #36688

Closed

Description

@zJaaal

Problem Statement

The Content Drive toolbar keyword / title search returns inconsistent, sometimes incoherent results. When a user types a title or keyword, the result list occasionally does not correspond to the query — either returning nothing coherent or items unrelated to the typed text. The behavior is intermittent, which suggests the issue is in the search-assembly / pagination path rather than a single malformed query.

Impact: affects anyone using Content Drive to locate content by name — keyword search is a primary way to find content, so incorrect results undermine trust in the tool. Content Drive is currently an in-development feature (behind the "in development" banner), so the impact is presently internal/admin, but it should be fixed before GA.

Browser & OS: appears environment-independent (this is a query/result-set issue, not rendering) — to be confirmed with a screencast.

Steps to Reproduce

Intermittent — a screencast should be captured. Approximate repro:

  1. Open Content Drive.
  2. In the toolbar keyword search, type a title or keyword known to exist in the current scope.
  3. Observe the result list.
  4. Intermittently, the results do not match the query — expected items are missing, or unrelated items are returned.

Likely depends on the number of matches, the folder-vs-content mix, which pagination page you're on, and the scored-title ordering.

Acceptance Criteria

Quick draft — to be refined after investigation.

  • Reproduce and characterize when the keyword/title search returns incoherent results (data shape, pagination page, folder+content mix, number of matches).
  • Identify the root cause within the Content Drive search path.
  • Keyword/title search returns results that consistently match the query — correct items and stable ordering — across all pages.

dotCMS Version

Latest from main (Content Drive is in-development / pre-GA).

Severity

Medium - Some functionality impacted

Links

NA


Technical context (for the investigator)

Content Drive search is a hybrid DB-first + Elasticsearch flow (ContentDriveHelper.driveSearch → BrowserAPIImpl) with cursor-based pagination and a scored title query. The keyword search builds a Lucene query roughly:

title:<kw>* OR title:'<kw>'^15 OR title_dotraw:*<kw>*^5 OR +catchall:*<kw>*^10

sorted by score descending. Suspected areas where the result set can become incoherent:

  • Hybrid DB-chunk + ES-filter pagination interacting with the score sort — score-based ordering may not be stable across DB chunks / cursor pages, so items can appear out of order, be skipped, or repeat.
  • Folders and content mixed in the same paginated result set under the cursor scheme.
  • catchall / _dotraw wildcard behavior vs. the analyzed title field (a leading/trailing wildcard on a keyword sub-field behaves differently from the analyzed match).

Related recent Content Drive work (context, not a dependency): #36383 / #36384 (field-based filters), #36638 (folder-tree loading), PR #36670.

Activity

  1. added theissue type on Jul 22, 2026
  2. changed the title [-]Content Drive keyword/title search returns inconsistent or incoherent results[/-] [+][BUG] Content Drive: keyword/title search returns inconsistent or incoherent results[/+] on Jul 22, 2026
  3. moved this from New to In Progress in dotCMS - Product Planningon Jul 27, 2026
  4. ihoffmann-dot commented on Jul 28, 2026

    @ihoffmann-dot
    Member

    Phase 0 baseline — root cause revised

    Reproduced with an integration test (ContentDriveKeywordSearchTest) that seeds IMG_1004.jpeg with synchronous indexing (IndexPolicy.WAIT_FOR) and searches via the real driveSearch path.

    Term Finds IMG_1004.jpeg?
    IMG, Img, img, 1004, IMG_1004, jpeg ✅ yes
    1004.jpeg ❌ no

    Findings:

    • Case is not the cause — uppercase IMG finds the file. An early case-sensitivity hypothesis is refuted.
    • With the file properly indexed, IMG/1004 both work — so the screencast (IMG/1004 returning nothing or unrelated items) is not reproducible against indexed data.
    • Best explanation of the screencast: Elasticsearch indexing lag (read-your-writes) — the just-uploaded file was not in ES yet, while already-indexed content whose body contains img surfaced instead. Content Drive routed the keyword search through Elasticsearch, which lags the DB (ADR-0018).
    • Secondary query defect: the free-text term is not tokenized, so boundary-spanning terms like 1004.jpeg miss.

    Fix (in progress): route the name/title keyword search to the database — case-insensitive, tokenized, no index lag — while keeping Elasticsearch for index-routed field filters. This makes a just-saved file findable by name immediately (read-your-writes). Validated: after the change, every term above (including 1004.jpeg) returns the file.

  5. github-actions commented on Jul 28, 2026

    @github-actions
    Contributor
  6. moved this from In Progress to In Review in dotCMS - Product Planningon Jul 28, 2026
  7. moved this from In Review to QA in dotCMS - Product Planningon Aug 3, 2026
  8. KevinDavilaDotCMS commented on Aug 10, 2026

    @KevinDavilaDotCMS
    Contributor

    QA Passed

    Tested in main 966e9d5

    2026-08-10.14-24-23.mov
  9. removed their assignment
    on Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions