ps:如只需要解决方案,则直接翻至底部
我这里springboot使用版本为2.3.0.RELEASE,使用的elasticsearch版本为6.2.2,在进行saveAll操作时,出现如下异常信息,不单是save操作,其他操作均出现一样。
save异常信息:
org.elasticsearch.ElasticsearchStatusException: Elasticsearch exception [type=action_request_validation_exception, reason=Validation Failed: 1: type is missing;2: type is missing;3: type is missing;4: type is missing;5: type is missing;6: type is missing;7: type is missing;8: type is missing;9: type is missing;10: type is missing;11: type is missing;]
查看save的对象,上的@Document注解,发现type属性在spring-data-elasticsearch4.0以及以后被废弃,跟着说明文档进去,在elasticsearch7.0以及以后API的版本不在支持types