Using include_type_name in create index requests is deprecated.

完整报错信息

02-25 20:06:14.214 [main] WARN org.elasticsearch.client.RestClient - request [PUT http://192.168.178.129:9200/hotel?master_timeout=30s&include_type_name=true&timeout=30s] returned 1 warnings: [299 Elasticsearch-7.12.1-3186837139b9c6b6d23c3200870651f10d3343b7 "[types removal] Using include_type_name in create index requests is deprecated. The parameter will be removed in the next major version."]

ElasticsearchStatusException[Elasticsearch exception [type=mapper_parsing_exception, reason=Failed to parse mapping [properties]: Root mapping definition has unsupported parameters: [all : {analyzer=ik_max_word, type=text}] [score : {type=integer}] [address : {index=false, type=keyword}] [business : {copy_to=all, type=keyword}] [city : {type=keyword}] [price : {type=integer}] [starName : {type=keyword}] [name : {copy_to=all, analyzer=ik_max_word, type=text}] [location : {type=geo_point}] [id : {type=keyword}] [pic : {index=false, type=keyword}] [brand : {copy_to=all, type=keyword}]]

]; nested: ElasticsearchException[Elasticsearch exception [type=mapper_parsing_exception, reason=Root mapping definition has unsupported parameters: [all : {analyzer=ik_max_word, type=text}] [score : {type=integer}] [address : {index=false, type=keyword}] [business : {copy_to=all, type=keyword}] [city : {type=keyword}] [price : {type=integer}] [starName : {type=keyword}] [name : {copy_to=all, analyzer=ik_max_word, type=text}] [location : {type=geo_point}] [id : {type=keyword}] [pic : {index=false, type=keyword}] [brand : {copy_to=all, type=keyword}]]];

错误原因

CreateIndexRequest request = new CreateIndexRequest("hotel");

的选择出错

import org.elasticsearch.action.admin.indices.create.CreateIndexRequest;

应该是

import org.elasticsearch.client.indices.CreateIndexRequest;

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值