Skip to content

Instantly share code, notes, and snippets.

@brycemcd
Created August 17, 2015 21:03
Show Gist options
  • Save brycemcd/69107c557af43ab8e7e9 to your computer and use it in GitHub Desktop.
Save brycemcd/69107c557af43ab8e7e9 to your computer and use it in GitHub Desktop.
retrieve a set of basic statistics about my accept/reject rate of links sent to me in email
GET /email_links/email_link/_search
{
"size": 0,
"aggs": {
"decision_count": {
"terms": {
"field": "accepted"
}
},
"total_articles_over_time": {
"date_histogram": {
"field": "accept_or_reject_dttm",
"interval": "week"
},
"aggs": {
"accept_status": {
"terms": {
"field": "accepted"
}
}
}
},
"total_articles_by_sender": {
"date_histogram": {
"field": "accept_or_reject_dttm",
"interval": "week"
},
"aggs": {
"accept_status": {
"terms": {
"field": "from_name"
}
}
}
},
"sent_articles_by_name_and_date": {
"terms": {
"field": "from_name"
},
"aggs": {
"by_date": {
"date_histogram": {
"field": "accept_or_reject_dttm",
"interval": "week"
},
"aggs": {
"accept_status": {
"terms": {
"field": "accepted"
}
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment