Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

966
Views
Elasticsearch object mapping for tried to parse field [null] as object, but found a concrete value

How can I change mapping or my input to resolve these error, using elasticsearch on AWS,

Mapping:

{
    "index_patterns": ["*-students-log"],
    "mappings": {
        "properties": {
            "Data": {
                "type": "object",
                "properties": {
                    "PASSED": {
                        "type": "object"
                    }
                }
            },
            "insertion_timestamp": {
                "type": "date",
                "format": "epoch_second"
            }
        }
    }
}

My data :

curl -XPOST -H 'Content-Type: application/json' https://******.us-east-1.es.amazonaws.com/index_name/_doc/1 -d '{"Data": {"PASSED": ["Vivek"]},"insertion_timestamp": 1591962493}'

Error I got :

{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"object mapping for [Data.PASSED] tried to parse field [null] as object, but found a concrete value"}],"type":"mapper_parsing_exception","reason":"object mapping for [Data.PASSED] tried to parse field [null] as object, but found a concrete value"},"status":400}

What is the missing or wrong piece in the above data? Is there any other datatype I should use for array of string? Any help would be appreciated...

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

JSON arrays are not considered JSON objects when ingested into Elasticsearch.

The docs state the following regarding arrays:

There is no dedicated array datatype. Any field can contain zero or more values by default, however, all values in the array must be of the same datatype.

So, instead of declaring the whole array as an object, speficy the array entries' data type (text) directly:

PUT abc-students-log
{
  "mappings": {
    "properties": {
      "Data": {
        "type": "object",
        "properties": {
          "PASSED": {
            "type": "text"   
          }
        }
      },
      "insertion_timestamp": {
        "type": "date",
        "format": "epoch_second"
      }
    }
  }
}
POST abc-students-log/_doc
{
  "Data": {
    "PASSED": [
      "Vivek"
    ]
  },
  "insertion_timestamp": 1591962493
}
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!