opensearch-project / opensearch-project/opensearch-java

[BUG] DerivedField contains additional unsupported `name` parameter

Open
#1,937 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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?
  1. Use the OpenSearch Java client to create a DerivedField.
  2. The client generates a mapping like the following JSON as one is forced to provide name as a field:
{
    "derived": {
      "derivedFieldName": {
        "format": "yyyy-MM-dd",
        "name": "derivedFieldName", // Problematic name parameter
        "script": { ... },
        "type": "date"
      }
    }
}
  1. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.