Elasticsearch service throwing failed to parse exception while indexing content

We are trying to index document in Elasticsearch with below structure,

{
  "data": {
    "blocks": [
      {
        "block": {
          "note": "<p>Test</p>",
          "digital-asset-service": ""
        }
      },
      {
        "block": "Hello"
      }
    ],
    "categories": {
      "year": [
        "Current Year"
      ],
      "region": [
        "United States"
      ]
    }
  }
}

Having mapping configuration as below,

{
  "settings": {
    "index": {
      "number_of_replicas": 1,
      "number_of_shards": 1,
      "max_result_window": "30000"
    }
  },
  "mappings": {
    "catalog": {
      "dynamic": "false",
      "properties": {
        "data": {
          "dynamic": "false",
          "type": "object",
          "properties": {
            "categories": {
              "dynamic": "true",
              "type": "object"
            }
          }
        }
      }
    }
  }
}

Document is getting indexed via lambda, but throwing below error,

RequestError(400, 'mapper_parsing_exception', 'failed to parse [data.blocks.block]'

Interestingly, when tried indexing/updating document directly via Kibana dev tools, it works without any issue.

Intention is to ignore data.blocks.block from mapping. But its not happening as per the documentation.

Thanks in advance.

Welcome to our community! :smiley:

What are you using to send these to Elasticsearch?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.