Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

972
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda