From 5578d6fb80320057172a50a272080b2158709e3b Mon Sep 17 00:00:00 2001 From: Aivaras Gotovskis <aivaras.gotovskis@ongr.io> Date: Fri, 10 Jul 2015 13:53:24 +0300 Subject: [PATCH] Fix top hits aggregation doc. --- docs/Aggregation/TopHits.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/Aggregation/TopHits.md b/docs/Aggregation/TopHits.md index 2b3d08f..33ba81e 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'); -- GitLab