Phone.java 734 Bytes
package com.esboot.bertsearch.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
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
@NoArgsConstructor
@AllArgsConstructor
@Document(indexName = "phones")
public class Phone {

    @Id
    private String id;

    @Field(name = "model", type = FieldType.Text)
    private String model;

    @Field(name = "price", type = FieldType.Integer)
    private int price;

    @Field(name = "date", type = FieldType.Text)
    private String date;
}