Skip to content

Latest commit

 

History

History
20 lines (19 loc) · 466 Bytes

Aggregation.md

File metadata and controls

20 lines (19 loc) · 466 Bytes

Aggregation

  • First aggregation query:
curl -XPOST 'http://localhost:9200/ordering/order/_search?pretty=true' -d '
{
  "size": 0, 
  "aggregations": {
    "order-status": {
      "terms": {
        "field": "status"
      }
    }
  }
}'
  • "size": 0 - suppress query results to fetch aggregations results only
  • "aggregations" or "aggs" - part of ElasticSearch Dsl
  • "order-status" - arbitrary name for aggregation
  • "terms" - type of aggregation to use