Saving ENUM in spring data elasticsearch

Viewed 3937

I am trying to save my entity in elasticsearch using spring data elasticsearch, all the attributes are saved (including objects) except for enum its always stored as null, this is my entity

@Entity
@Document(indexName="invoices", type="invoices", shards = 1)
public class Invoice {

@Transient
@JsonIgnore
@org.springframework.data.annotation.Id
private String searchIndex;

@Field(type = FieldType.String)
private InvoiceStateEnum state;

with and without @Field attribute state is being saved as null even though the object is being saved has value for this enum.

Any help is appreciated

2 Answers
Related