Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

967
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda