diff --git a/docs/Aggregation/TopHits.md b/docs/Aggregation/TopHits.md index f70995be58711964ae1b7aa3841626f962e686f1..9f446864527334c715957a7b1225d81f633ff245 100644 --- a/docs/Aggregation/TopHits.md +++ b/docs/Aggregation/TopHits.md @@ -43,7 +43,7 @@ so that the top matching documents can be aggregated per bucket. And now the query via DSL: ```php -$sort = new Sort('last_activity_date', Sort::ORDER_DESC); +$sort = new FieldSort('last_activity_date', Sort::DESC); $sorts = new Sorts(); $sorts->addSort($sort); $topHitsAggregation = new TopHitsAggregation('top_tag_hits', 1, null, $sorts); diff --git a/src/SearchEndpoint/SortEndpoint.php b/src/SearchEndpoint/SortEndpoint.php index d19249d7698023a4e5487d1c6971c53f2c328e9b..ce557fdfa0e66d7751e3f4b9a1ef2152d20ed1a8 100644 --- a/src/SearchEndpoint/SortEndpoint.php +++ b/src/SearchEndpoint/SortEndpoint.php @@ -13,7 +13,7 @@ namespace ONGR\ElasticsearchDSL\SearchEndpoint; use ONGR\ElasticsearchDSL\BuilderInterface; use ONGR\ElasticsearchDSL\Sort\AbstractSort; -use ONGR\ElasticsearchDSL\Sort\Sorts; +use ONGR\ElasticsearchDSL\Sort\FieldSort; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; /**