Skip to content

Instantly share code, notes, and snippets.

Created September 7, 2012 11:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/3665247 to your computer and use it in GitHub Desktop.
Save anonymous/3665247 to your computer and use it in GitHub Desktop.
microsecond date format test
curl -X DELETE "http://localhost:9200/testlog"
curl -X PUT "http://localhost:9200/testlog" -d '
{
"mappings": {
"log1" : {
"properties" : {
"message" : {
"type" : "string",
"index" : "analyzed"
},
"time" : {
"type" : "date",
"format" : "yyyy-MM-dd HH:mm:ss.SSSSSS",
"index" : "not_analyzed"
}
}
}
}
}
'
curl -X POST "http://localhost:9200/testlog/log1" -d '
{
"message" : "test1",
"time" : "2012-01-01 01:01:01.000001"
}
'
curl -X POST "http://localhost:9200/testlog/log1" -d '
{
"message" : "test2",
"time" : "2012-01-01 01:01:01.000002"
}
'
curl -X POST "http://localhost:9200/testlog/log1" -d '
{
"message" : "test3",
"time" : "2012-01-01 01:01:01.000003"
}
'
curl -X POST "http://localhost:9200/testlog/log1" -d '
{
"message" : "test4",
"time" : "2012-01-01 01:01:01.000004"
}
'
curl -X POST "http://localhost:9200/testlog/_refresh"
curl -X POST "http://localhost:9200/testlog/_search?pretty=true" -d '
{
"from" : 0,
"query" : {
"match_all" : {}
},
"sort":{
"time":{
"order":"desc"
}
}
}
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment