Skip to main content
Solved

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

  • 17 October 2017
  • 1 reply
  • 10 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?

View original
Did this help you find an answer to your question?

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?


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings