Skip to content

[BUG] "." as field name yields array_index_out_of_bounds_exception #14911

Closed
@shdubsh

Description

@shdubsh

Describe the bug

"." as field name yields array_index_out_of_bounds_exception

Related component

Indexing

To Reproduce

Dev Tools:

POST index_name/_doc
{".":"foo"}

Yields

{
  "error": {
    "root_cause": [
      {
        "type": "mapper_parsing_exception",
        "reason": "failed to parse"
      }
    ],
    "type": "mapper_parsing_exception",
    "reason": "failed to parse",
    "caused_by": {
      "type": "array_index_out_of_bounds_exception",
      "reason": "Index -1 out of bounds for length 0"
    }
  },
  "status": 400
}

Expected behavior

We could either index the document or yield a better error message.

Additional Details

Plugins
Defaults in docker

Screenshots
n/a

Host/Environment (please complete the following information):

  • OS: n/a - using docker.io/opensearchproject/opensearch:latest
  • Version - affects 2.15.0 and earlier

Additional context
n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    IndexingIndexing, Bulk Indexing and anything related to indexingbugSomething isn't workingv2.17.0v3.0.0Issues and PRs related to version 3.0.0

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions