Skip to content

[BUG] DerivedField contains additional unsupported name parameter #1937

Description

@e-wag

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions