opensearch-project / opensearch-project/opensearch-java
[BUG] DerivedField contains additional unsupported `name` parameter
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 165
- Forks
- 250
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 26
Description
What is the bug?
When building a DerivedField using the OpenSearch Java client, the generated mapping
includes a name field within the derived field definition (also see here). This causes OpenSearch to
return a mapper_parsing_exception error: "unknown parameter [name] on mapper
[derivedField] of type [date]".
How can one reproduce the bug?
- Use the OpenSearch Java client to create a DerivedField.
- The client generates a mapping like the following JSON as one is forced to provide
nameas a field:
{
"derived": {
"derivedFieldName": {
"format": "yyyy-MM-dd",
"name": "derivedFieldName", // Problematic name parameter
"script": { ... },
"type": "date"
}
}
}
- Submit this mapping to OpenSearch.
What is the expected behavior?
The mapping should be accepted by OpenSearch without errors. The name` field should not be present, as it is not supported according to these docs here.
What is your host/environment?
- OpenSearch Java client 3.5.0
- OpenSearch server 3.5.0
- macOS 26.3.1
Do you have any additional context?
As far as I can tell, the name should be the key of the map in the search request here.
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 with the generated DerivedField.java definition and compare it with the map-key usage in SearchRequest.java and the documented Derived field parameters. Reproduce the mapping from the issue against OpenSearch 3.5.0 and trace where the generated name field originates. Done means the client request no longer includes name and the mapping is accepted without the mapper_parsing_exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100