Mapping从配置文件读取的:
"typename":{
"properties": {
"title": {
"type": "text"
"index": "analyzed"
"analyzer": "by_max_word"
"search_analyzer": "by_smart"
}
}
}
,
在配置好Mapping后,执行这个方法
IndexResponse response = client
.prepareIndex("myindex","custom")
.setSource(
jsonBuilder().startObject()
.field("title", "夜神了,番茄宫谁在写诗,已经有20年历史了")
.endObject()).get();
报错了:java.lang.IllegalArgumentException: Rejecting mapping update to [myindex] as the final mapping would have more than 1 type。
遇过这个问题的同学可以帮忙解答下该怎么解决么
"typename":{
"properties": {
"title": {
"type": "text"
"index": "analyzed"
"analyzer": "by_max_word"
"search_analyzer": "by_smart"
}
}
}
,
在配置好Mapping后,执行这个方法
IndexResponse response = client
.prepareIndex("myindex","custom")
.setSource(
jsonBuilder().startObject()
.field("title", "夜神了,番茄宫谁在写诗,已经有20年历史了")
.endObject()).get();
报错了:java.lang.IllegalArgumentException: Rejecting mapping update to [myindex] as the final mapping would have more than 1 type。
遇过这个问题的同学可以帮忙解答下该怎么解决么
1 个回复
Yu Tao
赞同来自:
它的报错是说,你在一个index上面 创建了多个type