我只有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]有不同的[索引]值]