【发布时间】:2019-04-22 23:50:00
【问题描述】:
场景:我正在尝试将 json 数据索引到 elastic 中。我收到类似的错误
17:13:38.146 [主要] 错误 com.opnlabs.lighthouse.elastic.ElasticSearchIndexer - {"root_cause":[{"type":"illegal_argument_exception","reason":"不能 合并非对象映射 [map.audits.map.font-size.map.details.map.items.myArrayList.map.selector] 使用对象映射 [map.audits.map.font-size.map.details.map.items.myArrayList.map.selector]"}],"type":"illegal_argument_exception","reason":"不能 合并非对象映射 [map.audits.map.font-size.map.details.map.items.myArrayList.map.selector] 使用对象映射 [map.audits.map.font-size.map.details.map.items.myArrayList.map.selector]"}
是什么导致了这个问题?请帮忙
代码
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);
基本上我正在尝试将 3 个 json 值添加到弹性索引中。请帮我解决我做错的事情。
【问题讨论】:
标签: java spring-boot elasticsearch