diff --git a/docs/Aggregation/TopHits.md b/docs/Aggregation/TopHits.md index 2b3d08fcc18235aeb67a87570c034f6891be134f..33ba81ea357109dd0d271f4ad8de6d06c70973e7 100644 --- a/docs/Aggregation/TopHits.md +++ b/docs/Aggregation/TopHits.md @@ -44,7 +44,9 @@ And now the query via DSL: ```php $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']]); $termsAggregation = new TermsAggregation('top-tags', 'tags');