ESBook.java 997 Bytes
Newer Older
cloudgyb's avatar
cloudgyb committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
package com.gyb.elasticsearch.demo.entity.es;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

/**
 * @author geng
 * 2020/12/18
 */
@Data
@Document(indexName = "book")
public class ESBook {
    @Id
    @Field(type = FieldType.Text)
    private String id;
cloudgyb's avatar
cloudgyb committed
22
    @Field(type=FieldType.Text,analyzer="ik_max_word")
cloudgyb's avatar
cloudgyb committed
23
    private String title;
cloudgyb's avatar
cloudgyb committed
24
    @Field(type=FieldType.Text,analyzer="ik_max_word")
cloudgyb's avatar
cloudgyb committed
25 26 27 28 29 30 31 32
    private String author;
    @Field(type = FieldType.Double)
    private Double price;
    @Field(type = FieldType.Date,format = DateFormat.basic_date_time)
    private Date createTime;
    @Field(type = FieldType.Date,format = DateFormat.basic_date_time)
    private Date updateTime;
}