Skip to content

Instantly share code, notes, and snippets.

@jackielii
Last active February 20, 2020 13:25
Show Gist options
  • Save jackielii/8d7ba0909a85dc4894468e292335e8e4 to your computer and use it in GitHub Desktop.
Save jackielii/8d7ba0909a85dc4894468e292335e8e4 to your computer and use it in GitHub Desktop.
curl -X PUT "localhost:9200/datenano?pretty" -H 'Content-Type: application/json' -d'
{
"mappings": {
"dynamic" : "strict",
"properties" : {
"datefield" : {
"type": "date_nanos",
"format": "strict_date_hour_minute_second_millis"
}
}
}
}'
curl -X PUT "localhost:9200/datenano/_doc/1?pretty" -H 'Content-Type: application/json' -d'
{
"datefield": "2022-11-08T11:39:13.12345011"
}'
curl -X GET "localhost:9200/datenano/_doc/1?pretty"
curl -X POST "localhost:9200/datenano/_search?pretty" -H 'Content-Type: application/json' -d'
{
"size":0,
"aggregations": {
"mindate": {
"min":{
"field":"datefield"
}
}
}
}'
# created issue https://github.com/elastic/elasticsearch/issues/52568
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment