Skip to content

Instantly share code, notes, and snippets.

@jprante
Created October 2, 2013 14:16
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 jprante/6794460 to your computer and use it in GitHub Desktop.
Save jprante/6794460 to your computer and use it in GitHub Desktop.
Timestamp field must to stored to get returned
curl -XDELETE 'localhost:9200/test'
curl -XPUT 'localhost:9200/test/' -d '
{
"mappings" : {
"_default_": {
"_timestamp" : { "enabled" : true, "store" : true }
}
}
}
'
curl -XPUT 'localhost:9200/test/doc/1' -d '
{
"sentence" : "Hi!",
"value" : 1
}
'
curl 'localhost:9200/test/_refresh'
curl -XPOST 'localhost:9200/test/_search' -d '
{
"query" : {
"match_all" : {
}
},
"fields" : [ "_timestamp" ]
}
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment