我安装了es版本为6.4.0和分词器,postman测试也成功。但是mall-search项目启动报错了,帮忙看下这是什么原因呢?报错信息如下: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'esProductController': Unsatisfied dependency expressed through field 'esProductService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'esProductServiceImpl': Unsatisfied dependency expressed through field 'productRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'esProductRepository' defined in com.macro.mall.search.repository.EsProductRepository defined in @EnableElasticsearchRepositories declared on ElasticsearchRepositoriesRegistrar.EnableElasticsearchRepositoriesConfiguration: Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.elasticsearch.repository.support.SimpleElasticsearchRepository]: Constructor threw exception; nested exception is RestStatusException{status=400} org.springframework.data.elasticsearch.RestStatusException: Elasticsearch exception [type=mapper_parsing_exception, reason=Failed to parse mapping [properties]: Root mapping definition has unsupported parameters: [brandName : {type=keyword}] [productSn : {type=keyword}] [subTitle : {analyzer=ik_max_word, type=text}] [keywords : {analyzer=ik_max_word, type=text}] [productCategoryName : {type=keyword}] [name : {analyzer=ik_max_word, type=text}] [attrValueList : {type=nested, properties={name={type=keyword}, _class={index=false, type=keyword, doc_values=false}, value={type=keyword}}}] [_class : {index=false, type=keyword, doc_values=false}]]; nested exception is ElasticsearchStatusException[Elasticsearch exception [type=mapper_parsing_exception, reason=Failed to parse mapping [properties]: Root mapping definition has unsupported parameters: [brandName : {type=keyword}] [productSn : {type=keyword}] [subTitle : {analyzer=ik_max_word, type=text}] [keywords : {analyzer=ik_max_word, type=text}] [productCategoryName : {type=keyword}] [name : {analyzer=ik_max_word, type=text}] [attrValueList : {type=nested, properties={name={type=keyword}, _class={index=false, type=keyword, doc_values=false}, value={type=keyword}}}] [_class : {index=false, type=keyword, doc_values=false}]]]; nested: ElasticsearchException[Elasticsearch exception [type=mapper_parsing_exception, reason=Root mapping definition has unsupported parameters: [brandName : {type=keyword}] [productSn : {type=keyword}] [subTitle : {analyzer=ik_max_word, type=text}] [keywords : {analyzer=ik_max_word, type=text}] [productCategoryName : {type=keyword}] [name : {analyzer=ik_max_word, type=text}] [attrValueList : {type=nested, properties={name={type=keyword}, _class={index=false, type=keyword, doc_values=false}, value={type=keyword}}}] [_class : {index=false, type=keyword, doc_values=false}]]];
Q
[macrozheng/mall]mall-search项目启动报Error creating bean with name 'esProductController'
9
A
回答
5
需要使用7.17.3版本的ES
2
可以了 ❥