To set a `java.util.Date` typed field as `date` type in Elasticsearch,
use `@Field` as follows:
@Field(type = FieldType.Date)
private Date timestamp;
and check as follows:
curl -XGET 'http://localhost:9200/event/_mapping?pretty'
and then you will see as follows:
"timestamp" : {
"type" : "date",
"format" : "dateOptionalTime"
}
No comments:
Post a Comment