Здравствуйте. В результатах "Умного поиска" элементы отображаются в странном порядке (предположительно, по алфавиту).
Из коробки нет возможности сделать сортировку "По дате" (новые сначала).
Рекомендуют открыть файл .../components/com_finder/models/
search.php и поработать с
getResultsData.
Можете что-нибудь подсказать?
Спасибо.
Фрагменты из файла ниже:
// Get the row data.
$items = $this->getResultsData();
Может быть здесь в AS ordering?
protected function getResultsData()
{
// Get the store id.
$store = $this->getStoreId('getResultsData', false);
// Use the cached data if possible.
if ($this->retrieve($store))
{
return $this->retrieve($store);
}
// Get the result ordering and direction.
$ordering = $this->getState('list.ordering', 'l.start_date');
$direction = $this->getState('list.direction', 'DESC');
// Get the base query and add the ordering information.
$base = $this->getListQuery();
$base->select($this->_db->escape($ordering). ' AS ordering');
$base->order($this->_db->escape($ordering). ' ' . $this->_db->escape($direction));
/*
* If there are no optional or required search terms in the query, we
* can get the results in one relatively simple database query.
*/
if (empty($this->includedTerms))
{
// Get the results from the database.
$this->_db->setQuery($base, (int) $this->getState('list.start'), (int) $this->getState('list.limit'));
$return = $this->_db->loadObjectList('link_id');
// Get a new store id because this data is page specific.
$store = $this->getStoreId('getResultsData', true);
// Push the results into cache.
$this->store($store, $return);
// Return the results.
return $this->retrieve($store);
}
// Create a storage key for this set.
$setId = $this->getStoreId('getResultsData:' . serialize(array_values($ids)). ':' . $start . ':' . $limit);
// Create a storage key for this set.
$setId = $this->getStoreId('getResultsData:required:' . serialize(array_values($required)). ':' . $start . ':' . $limit);