Elasticsearch failed 'type illegal_argument_exception' but was defined as String
We get an error of the Elasticsearch by saving a BusinessObject over the ivy.repo with a field of type <code>Map < String , String <code>Map< String,String ></code>.
<pre><code>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]"}</code></pre>
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!<br>
The field "data" of the "detail" object is defined as a Map<String, String>.<br><code>Map< String,String ></code>.<br>
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).
<pre><code>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);</code></pre>
Why does Elasticsearch change the given attribute to a date field, although we just fill in String values?<br>
Furthermore we defined the value as a Map of Sting-String value pairs.<br>
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.