LoginSignup
2
2

More than 5 years have passed since last update.

elasticsearchのクエリ

Posted at

elasticsearchのクエリ

AWS EC2上にfluentd + fluent-plugin-twitter + elasticsearch + kibana インストールするメモ
で蓄積したTweetデータに対して、使いそうなelasticsearchのクエリをまとめました。

インデックスの確認

$ curl -X GET http://localhost:9200/_aliases

tweetsの全データ取得

$ curl -XGET 'http://localhost:9200/tweets/_search?pretty=true' -d '
{
"query" : {
"matchAll" : {}
}
}'

tweetsの期間指定でのデータの取得

$ curl -XGET 'http://localhost:9200/tweets/_search?pretty=true' -d '
{
"query" : {
"range" : {
"created_at" : { "from" : "2015-03-07T00:00:00", "to" : "2015-03-10T00:00:00" }
}
}
}'
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2