abstract class AbstractSearcher implements SearcherInterface
Methods
No description
The direction of the last ordering in a list, or ascending if it has none.
Details
at
line 22
__construct(FilterManager $filters, array $mutators)
at
line 29
SearchResults
search(SearchCriteria $criteria)
at
line 80
protected void
applySort(DatabaseSearchState $state, array|null $sort = null, bool $sortIsDefault = false)
at
line 109
protected void
applyTieBreaker(DatabaseSearchState $state)
Order rows the requested sort leaves tied.
Sorting by a column that isn't unique leaves the order of tied rows to the database, which is free to differ between engines, versions and even executions. Results are then paginated by offset, so an unstable order can repeat a row on one page and skip it on the next. Ending every sort on the primary key makes the order total.
at
line 139
static protected string
lastOrderDirection(array|null $orders)
The direction of the last ordering in a list, or ascending if it has none.
The tie breaker follows it rather than always ascending: an InnoDB secondary index already carries the primary key, so `column DESC, id DESC` is still answered by an index on `column` alone, where mixing the two directions forces a filesort.