dev/doc_agg_date.txt
changeset 414 5c6c526a7fc1
parent 413 8f29358e46da
child 415 0046797e0411
equal deleted inserted replaced
413:8f29358e46da 414:5c6c526a7fc1
     1 {
       
     2     "size": 0,
       
     3     "query": { "match_all": [] },
       
     4     "aggs": {
       
     5         "datestats": {
       
     6             "nested": {
       
     7                 "path": "creation_years"
       
     8             },
       
     9             "aggs": {
       
    10                 "years": {
       
    11                     "terms": {
       
    12                         "field": "creation_years.year",
       
    13                         "size": 0,
       
    14                         "order": {
       
    15                             "_term": "asc"
       
    16                         }
       
    17                     },
       
    18                     "aggs": {
       
    19                         "year_count": {
       
    20                             "sum": {
       
    21                                 "field": "creation_years.weight"
       
    22                             }
       
    23                         }
       
    24                     }
       
    25                 }
       
    26             }
       
    27         }
       
    28     }
       
    29 }