1// aggregations/bucket/terms-aggregation.asciidoc:264 2 3[source, php] 4---- 5$params = [ 6 'body' => [ 7 'aggs' => [ 8 'products' => [ 9 'terms' => [ 10 'field' => 'product', 11 'size' => 5, 12 'show_term_doc_count_error' => true, 13 ], 14 ], 15 ], 16 ], 17]; 18$response = $client->search($params); 19---- 20