PUT test
{
"mappings": {
"type": {
"properties": {
"inserted": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss.SSSSSS"
}
}
}
}
}
PUT /test/type/1
{
"inserted" : "2017-03-15 23:39:03.000000"
}
PUT /test/type/2
{
"inserted" : "2017-03-15 23:39:03.002000"
}
However, be aware that Elasticsearchs date type internally stores dates with only milliseconds precision as you can see when you search for the above documents and look at the internally stored values:
GET /test/type/_search
{
"docvalue_fields" : ["inserted"]
}
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.