Skip to main content
Solved

How can you get the ElasticSearch writer index mapping properties as "type : nested"?

  • October 17, 2017
  • 1 reply
  • 20 views

Forum|alt.badge.img+3

According to the Elastic documentation: "The 'nested' type is a specialised version of the 'object' datatype that allows arrays of objects to be indexed and queried independently of each other." Nested objects allow you to filter on multiple fields within the same objects in arrays.

Is it possible to get the ElasticSearch writer to write the properties as "type : nested", as shown here:
PUT /my_index
{
  "mappings": {
    "blogpost": {
      "properties": {
        "comments": {
          "type": "nested", 
          "properties": {
            "name":    { "type": "string"  },
            "comment": { "type": "string"  },
            "age":     { "type": "short"   },
            "stars":   { "type": "short"   },
            "date":    { "type": "date"    }
          }
        }
      }
    }
  }
}

Best answer by jakemolnar

One quick workaround would be to use an HTTPCaller to `PUT` this mapping before writing to it with the Elasticsearch Writer.

Beyond that, we presently don't have an option to write `nested` fields, but that is certainly within the realm of possibility. Is this an important feature for your use case?

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

jakemolnar
Forum|alt.badge.img
  • Best Answer
  • October 23, 2017

One quick workaround would be to use an HTTPCaller to `PUT` this mapping before writing to it with the Elasticsearch Writer.

Beyond that, we presently don't have an option to write `nested` fields, but that is certainly within the realm of possibility. Is this an important feature for your use case?