Scenario : I am trying to index json data into elastic . I am getting an error like
17:13:38.146 [main] ERROR com.opnlabs.lighthouse.elastic.ElasticSearchIndexer - {"root_cause":[{"type":"illegal_argument_exception","reason":"Can't merge a non object mapping [map.audits.map.font-size.map.details.map.items.myArrayList.map.selector] with an object mapping [map.audits.map.font-size.map.details.map.items.myArrayList.map.selector]"}],"type":"illegal_argument_exception","reason":"Can't merge a non object mapping [map.audits.map.font-size.map.details.map.items.myArrayList.map.selector] with an object mapping [map.audits.map.font-size.map.details.map.items.myArrayList.map.selector]"}
What is causing the issue ? Please help
Code
JSONObject newJsonObject = new JSONObject();
JSONObject log = jsonObject.getJSONObject("audits");
JSONObject log1 = jsonObject.getJSONObject("categories");
newJsonObject.put("audits", log);
newJsonObject.put("categories", log1);
newJsonObject.put("timeStamp", time);
Index index = new Index.Builder(newJsonObject).index(mongoIndexName+"1").type("data").build();
DocumentResult a = client.execute(index);
Basically i m trying to add 3 json values into elastic index. Please help me with what i m doing wrong.