Skip to content

Commit

Permalink
Make it easier to override sort order in scheduled search notify comm…
Browse files Browse the repository at this point in the history
…and. (#4247)
  • Loading branch information
EreMaijala authored Feb 14, 2025
1 parent 5249ea8 commit dd3f8c6
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ class NotifyCommand extends Command implements TranslatorAwareInterface
*/
protected $limit = 50;

/**
* Sort order to use when performing searches
*
* @var string
*/
protected $sort = 'first_indexed desc';

/**
* Constructor
*
Expand Down Expand Up @@ -311,7 +318,7 @@ protected function getNewRecords($searchObject, $lastTime)
// Prepare query
$params = $searchObject->getParams();
$params->setLimit($this->limit);
$params->setSort('first_indexed desc', true);
$params->setSort($this->sort, true);
$searchId = $searchObject->getSearchId();
try {
$records = $searchObject->getResults();
Expand Down

0 comments on commit dd3f8c6

Please sign in to comment.