We get an error of the Elasticsearch by saving a BusinessObject over the ivy.repo with a field of type Map< String,String >
.
Elasticsearch update index of document failed because of: {"root_cause":[{"type":"illegal_argument_exception","reason":"mapper [details.data.Value1] of different type, current_type [text], merged_type [date]"}],"type":"illegal_argument_exception","reason":"mapper [details.data.Value1] of different type, current_type [text], merged_type [date]"}
The problem ist clear. The field "details.data.Value1" is a date field and i try to store a String.
But the definition of our BusinessObject is different to that!
The field "data" of the "detail" object is defined as a Map< String,String >
.
We get this error when we run the following code in an IvyScript (we used a helper class for Maps, because IvyScript is not able to handle double generics).
JobDetail detail = new JobDetail();
Helper helper = new Helper();
helper.setParam("Value1", (new Date()).toString());
detail.data = helper.getParams();
job.details.add(detail);
detail = new JobDetail();
helper.setParam("Value1", "foo");
detail.data = helper.getParams();
job.details.add(detail);
Why does Elasticsearch change the given attribute to a date field, although we just fill in String values?
Furthermore we defined the value as a Map of Sting-String value pairs.
Is there a solution of this issue?
We decided not to use JSON objects instead of our Map, because of the easy handling in further uses.
asked
31.07.2019 at 04:33
Adrian Imfeld
(suspended)
accept rate:
77%