模型更改后运行重新索引数据时出错

时间:2017-02-08 07:49:40

标签: java elasticsearch spring-boot spring-data-elasticsearch

我只有username字段=>的用户模型和指定索引它奏效了:

class User {

   @Field(type = FieldType.String, index = FieldIndex.analyzed)
   private String username;

   @Field(type = FieldType.String, index = FieldIndex.no)
   private String email;
}

之后,我添加了email字段的索引和&想重新索引数据:     class User {

   @Field(type = FieldType.String, index = FieldIndex.analyzed)
   private String username;

   @Field(type = FieldType.String, index = FieldIndex.analyzed)
   private String email;
}

我从Java方面得到错误:

  

引起:org.springframework.beans.BeanInstantiationException:无法实例化[org.springframework.data.elasticsearch.repository.support.NumberKeyedRepository]:构造函数抛出异常;嵌套异常是java.lang.IllegalArgumentException:[email]的Mapper与其他类型的现有映射冲突:   [mapper [email]有不同的[索引]值]

0 个答案:

没有答案