三人行必有我师

org.elasticsearch.index.mapper.MapperParsingException: No type specified for field

Elasticsearch | 作者 DeepRedApple | 发布于2018年02月11日 | 阅读数:5059

@Document(indexName = "blog", type = "blog")
public class EsBlog implements Serializable {

private static final long serialVersionUID = 1L;

@Id // 主键
private String id;
@Field(index = false)
private Long blogId; // Blog 实体的 id
private String title;
private String summary;
private String content;
@Field(index = false) // 不做全文检索字段
private String username;
@Field(index = false) // 不做全文检索字段
private String avatar;
@Field(index = false) // 不做全文检索字段
private Timestamp createTime;
@Field(index = false) // 不做全文检索字段
private Integer readSize = 0; // 访问量、阅读量
@Field(index = false) // 不做全文检索字段
private Integer commentSize = 0; // 评论量
@Field(index = false) // 不做全文检索字段
private Integer voteSize = 0; // 点赞量
@Field(type = FieldType.text, fielddata = true, searchAnalyzer = "ik_smart", analyzer = "ik_smart")
private String tags; // 标签
}
控制台出现org.elasticsearch.index.mapper.MapperParsingException: No type specified for field [blogId] 
已邀请:

要回复问题请先登录注册