String array values serialized as Java object reference in ES catchall field
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 970
- Forks
- 486
- Avg merge
- 3d 33m
- Merged PRs (30d)
- 170
Description
Problem Statement
When a contentlet containing an indexable attribute with a String[] value (e.g., categoryperms) is published, the catchall field in the Elasticsearch/OpenSearch index receives the raw Java object reference ([Ljava.lang.String;@<hashcode>) instead of the actual array elements joined as searchable terms.
Root cause: In ESMappingAPIImpl.java at line 600, the value is appended to the catchall StringBuilder without checking whether it is a String[]. When it is, StringBuilder.append(Object) calls .toString() on the array, which produces the Java reference representation rather than the element values.
Observed in: catchall field after publishing a Content (Generic) contentlet from the empty starter:
... notassigned [Ljava.lang.String;@7d0c268b true ...
Expected: The actual permission category values (the array elements) should appear in catchall as space-separated terms.
This does not appear to have been reported by customers, but the bug is reproducible locally and is provably broken in the current codebase.
Steps to Reproduce
- Start a dotCMS instance with the empty starter.
- Open the Content portlet and find a
Content (Generic)contentlet. - Publish the contentlet.
- Open the OpenSearch Dashboard and query the
catchallfield for that contentlet's identifier. - Observe that the
catchallvalue contains a token matching[Ljava.lang.String;@<hashcode>— this is thecategorypermsfield value serialized as a Java object reference.
Expected result: The categoryperms values appear as readable string tokens in catchall.
Actual result: The value appears as [Ljava.lang.String;@<hashcode>.
Acceptance Criteria
- Publishing a contentlet with an indexable
String[]attribute (e.g.,categoryperms) results in thecatchallES field containing the actual array element values as space-separated tokens — not a Java object reference. - The original bug scenario (publish
Content (Generic)→ inspectcatchallin OpenSearch Dashboard → see[Ljava.lang.String;@...) no longer reproduces. - Relationship field values continue to be excluded from the
catchallfield (existing behavior per Javadoc inESMappingAPIImplis preserved — no regression). - All existing unit and integration tests for
ESMappingAPIImplpass without modification.
dotCMS Version
Reproducible on latest main branch (confirmed 2026-06-18).
Severity
Medium - Some functionality impacted
Links
- Related issue: https://github.com/dotCMS/core/issues/35476 (discovered while working on this)
- Root cause:
ESMappingAPIImpl.java#L600
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.
Research direction
Start in dotCMS/src/main/java/com/dotcms/content/elasticsearch/business/ESMappingAPIImpl.java at line 600, where values are appended to the catchall StringBuilder. Run the existing unit and integration tests for ESMappingAPIImpl, then reproduce the Content (Generic) publishing scenario and inspect catchall in OpenSearch Dashboard. Done means String[] elements appear as space-separated searchable terms, Java references do not, and relationship values remain excluded.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elasticsearch, java
- Domain
- backend, search
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100