Skip to content

date field types fail to index specific malformed data even with ignore_malformed enabled #109539

@lkts

Description

@lkts

Elasticsearch Version

8.14

Installed Plugins

No response

Java Version

bundled

OS Version

Problem Description

As noticed in #109410 if a value of date or date_nanos field is an object, indexing such value will fail even with ignore_malformed enabled. This behavior differs from other field types like numbers.

Steps to Reproduce

PUT /my_index
{
  "mappings": {
      "properties": {
          "date": {
              "type": "date",
              "ignore_malformed": true
          }
        }
    }
  }
}

// OK
PUT my_index/_doc/1
{
  "date": "hello"
}

// Fails
PUT my_index/_doc/2
{
  "date": {"string": "hello"}
}

Logs (if relevant)

No response

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions