json - Elasticsearch Jackson Date type -
i'm using elasticsearch in order create index.
fasty.
i chose jackson in order generate elasticsearch index documents
so, i've created serializer:
public class digitalinputserializer extends jsonserializer<digitalinput> { @override public void serialize(digitalinput value, jsongenerator gen, serializerprovider serializers) throws ioexception, jsonprocessingexception { gen.writestartobject(); gen.writenumberfield("timestamp", value.gettimestamp().gettime()); <<<<<<<<<<<<<<< gen.writestringfield("matter", value.getmatter()); gen.writestringfield("comment", value.getcomment()); gen.writestringfield("channel_id", value.getchannelid()); gen.writeendobject(); } }
i've had surprise, when looked writedatefield
!!! isn't there!
chose index field using long field, i'm losing date type indexable features elasticsearch provides.
could me, please?
thanks all.
Comments
Post a Comment