The ingest plugin's Data class currently supports retrieval of a value using a path to a field specified in dot-notation (e.g. foo.bar). For more complex insertions, updates, and retrievals of nested fields within the document, it would be useful to be able to access fields through array/list typed fields.
The notation proposed here is to introduce a path element in the specified path that is an integer and is to be evaluated as an index into the parent array/list object.
# example paths
foo.bar.1.first
foo.4
foo.4.3.6.last
Here is an example:
data = new Data("index", "type", "id",
new HashMap<String, Object>() {{
put("foo", Arrays.asList("a", "b", "c");
put("fizz", new HashMap<String, Object>() {{
put("buzz", "hello world");
}});
}});
assertThat(data.getProperty("foo.1"), equalTo("b"))
addField is also meant to support this behavior. more functions will have to be introduced to distinguish between an append to an array, and a full replace.
The ingest plugin's Data class currently supports retrieval of a value using a path to a field specified in dot-notation (e.g.
foo.bar). For more complex insertions, updates, and retrievals of nested fields within the document, it would be useful to be able to access fields through array/list typed fields.The notation proposed here is to introduce a path element in the specified path that is an integer and is to be evaluated as an index into the parent array/list object.
Here is an example:
addFieldis also meant to support this behavior. more functions will have to be introduced to distinguish between an append to an array, and a full replace.