package com.search.entity.es;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
@Data
@Document(indexName = "customer")
public class Customer implements Serializable {
@Id
private Long customerId;
@Field(type = FieldType.Keyword)
private String nickname;
@Field(type = FieldType.Keyword)
private String authName;
@Field(type = FieldType.Keyword)
private String remarkName;
@Field(type = FieldType.Keyword)
private String mobile;
}
这是我的实体类,使用@Document
注解,再就是实现序列化接口Serializable
问题就是这里了,这个序列化
Serializable
我的解决方案就是去掉了Serializable
,重新做映射