Hi, I'm using a field, transactiontype, to return the count of each transaction type. The following code works but returns both the full number of hits and the counts.
Does anyone know what I do to return counts only? Maybe it's because I'm using _search in the url. I tried _count but that didn't work.
**{**
** "query": {**
** "match": {**
** "MAJORPOSTCODE": "WC1R,WC1A,WC1V,WC1B,WC1N,WC1X,WC1E,WC1H"**
** }**
** },**
** "aggs" : {**
** "Transactiontypes" : { "terms" : { "field" : "TRANSACTIONTYPE" } }**
** }**
**}**
Ideal Reponse
"aggregations": {
"count_by_type": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": "auction",
"doc_count": 43
},
{
"key": "lease",
"doc_count": 39
},