July 2018
Intermediate to advanced
336 pages
9h 23m
English
The implementation of the domain model Article using Elasticsearch annotations will look like the following:
@Document(indexName = "springboot2blog_article", type = "article")@Datapublic class Article { @Id private String id; private String title; private String link; private String summary; private String body; @Field(type = FieldType.Nested) private User author; @Field(type = FieldType.Date) private Date createdDate = new Date();}
In the preceding code, @Document is used to mark the Article class as an Elasticsearch document with the index name "springboot2blog_article" and the type "article". The @Id annotation marks the ID property as the identity field of the document. The @Data annotation is from Lombok ...
Read now
Unlock full access