-
Notifications
You must be signed in to change notification settings - Fork 480
Open
Copy link
Labels
Description
Problem Statement
When querying the /api/content/_search endpoint, even though languageId: 2 is explicitly requested in the query, the API retrieves the relationship field in the default language (languageId: 1) instead of the requested language.
POST /api/content/_search
{
"query": "+contentType:Demo1 +languageId:2 +live:true ...",
"depth": 3
}
As seen in the response below, the parent content is correctly returned in languageId: 2 ("Español"), but the nested relationship returns languageId: 1 ("Item 1 - English").
{
"text": "Español",
"languageId": 2, // Correct
"relationshipField": [
{
"title": "Item 1 - English",
"languageId": 1 // Incorrect - Should be 2 ("Item 1 - Spanish")
}
]
}
Steps to Reproduce
Create a parent content and a child both in a non-default language.
Attempt to retrieve the content and its child in the non-default language.
Problem: the parent comes in the expected language but child does not.
Acceptance Criteria
Language provided in the query is also respected for related content
dotCMS Version
Main / trunk_c02078b
Severity
Medium - Some functionality impacted
Links
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
In Review