Rejecting mapping update to [***] as the final mapping would have more than 1 type: [***, ***]

在整合springboot和elasticsearch時,使用spring data進行添加數據時,報錯:

org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'requestMappingHandlerAdapter' defined in class path resource 
[org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: 
    Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate 
[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: 
Factory method 'requestMappingHandlerAdapter' threw exception; 
nested exception is org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'mvcConversionService' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed;
 nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate 
[org.springframework.format.support.FormattingConversionService]:
 Factory method 'mvcConversionService' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bookRepository': Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.elasticsearch.repository.support.NumberKeyedRepository]: 
Constructor threw exception; nested exception is java.lang.IllegalArgumentException: 
Rejecting mapping update to [****] as the final mapping would have more than 1 type: [***, *****]

原因:

Elasticsearch 6.0 一個索引只允許有一個type;

Elasticsearch 7.0 沒有 Type 了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章