elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
69.72k stars 24.67k forks source link

`unsigned_long` field type fails to index specific malformed data even with `ignore_malformed` enabled #109705

Open lkts opened 3 months ago

lkts commented 3 months ago

Elasticsearch Version

8.15

Installed Plugins

No response

Java Version

bundled

OS Version

-

Problem Description

Trying to index an object into a unsigned_long field fails even with ignore_malformed enabled. See also #109539.

Steps to Reproduce

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

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

// fails
PUT my_index/_doc/2
{
  "ul": {"string": "hello"}
}

Logs (if relevant)

This happens because arser.text() throws IllegalStateException but only IllegalArgumentException is caught to handle malformed values.

elasticsearchmachine commented 3 months ago

Pinging @elastic/es-storage-engine (Team:StorageEngine)