Skip to content
Snippets Groups Projects
Commit 5578d6fb authored by Aivaras Gotovskis's avatar Aivaras Gotovskis
Browse files

Fix top hits aggregation doc.

parent 283f2d00
No related branches found
No related tags found
No related merge requests found
...@@ -44,7 +44,9 @@ And now the query via DSL: ...@@ -44,7 +44,9 @@ And now the query via DSL:
```php ```php
$sort = new Sort('last_activity_date', Sort::ORDER_DESC); $sort = new Sort('last_activity_date', Sort::ORDER_DESC);
$topHitsAggregation = new TopHitsAggregation('top_tag_hits', 1, null, $sort); $sorts = new Sorts();
$sorts->addSort($sort);
$topHitsAggregation = new TopHitsAggregation('top_tag_hits', 1, null, $sorts);
$topHitsAggregation->addParameter('_source', ['include' => ['title']]); $topHitsAggregation->addParameter('_source', ['include' => ['title']]);
$termsAggregation = new TermsAggregation('top-tags', 'tags'); $termsAggregation = new TermsAggregation('top-tags', 'tags');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment