033778305d52746f5ce0a2a922c8e521.asciidoc 438 B

1234567891011121314151617181920
  1. // aggregations/bucket/terms-aggregation.asciidoc:410
  2. [source, php]
  3. ----
  4. $params = [
  5. 'body' => [
  6. 'aggs' => [
  7. 'genres' => [
  8. 'terms' => [
  9. 'script' => [
  10. 'source' => 'doc[\'genre\'].value',
  11. 'lang' => 'painless',
  12. ],
  13. ],
  14. ],
  15. ],
  16. ],
  17. ];
  18. $response = $client->search($params);
  19. ----