package org.frekele.elasticsearch.entities;

import org.frekele.elasticsearch.annotations.Field;
import org.frekele.elasticsearch.annotations.Fields;
import org.frekele.elasticsearch.annotations.Mapping;
import org.frekele.elasticsearch.enums.FieldType;

@Mapping
public class Book {

    @Field(type = FieldType.LONG)
    private Long id;

    @Field(type = FieldType.TEXT)
    private String name;

    @Fields(type = FieldType.TEXT, fields = {
        @Field(type = FieldType.KEYWORD)}
    )
    private String description;

    public Book() {
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}

@@ -38,16 +38,71 @@
 ities;%0A%0A
+import org.frekele.elasticsearch.annotations.Document;%0A
 import o
@@ -202,62 +202,8 @@
 ds;%0A
-import org.frekele.elasticsearch.annotations.Mapping;%0A
 impo
@@ -254,15 +254,24 @@
 ;%0A%0A@
-Mapping
+Document(%22book%22)
 %0Apub

add @Document("book")