Skip to content

Instantly share code, notes, and snippets.

@up1
Created January 26, 2016 15:59
Show Gist options
  • Select an option

  • Save up1/4874b9a892d54ccd959a to your computer and use it in GitHub Desktop.

Select an option

Save up1/4874b9a892d54ccd959a to your computer and use it in GitHub Desktop.
Elasticsearch :: sample date
PUT log/web/1
{
"name" : "test",
"loged_date" : "2016/01/26 11:11:11"
}
PUT log/web/2
{
"name" : "test",
"loged_date" : "2016/01/27 11:11:11"
}
PUT log/web/2
{
"name" : "test",
"loged_date" : "2016/01/28 11:11:11"
}
GET log/web/_mapping
GET log/web/_search
{
"size": 0,
"aggs": {
"by_date": {
"date_histogram": {
"field": "loged_date",
"interval": "day"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment