Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions plugins/search/content/content.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public function onContentSearch($text, $phrase = '', $ordering = '', $areas = nu
switch ($ordering)
{
case 'oldest':
$order = 'a.created ASC';
$order = 'a.publish_up ASC';
break;

case 'popular':
Expand All @@ -256,7 +256,7 @@ public function onContentSearch($text, $phrase = '', $ordering = '', $areas = nu

case 'newest':
default:
$order = 'a.created DESC';
$order = 'a.publish_up DESC';
break;
}

Expand All @@ -282,7 +282,9 @@ public function onContentSearch($text, $phrase = '', $ordering = '', $areas = nu
$order = ' relevance DESC, ' . $order;
}

$query->select('a.title AS title, a.metadesc, a.metakey, a.created AS created, a.language, a.catid')
$query->select('a.id AS id, a.title AS title, a.metadesc AS metadesc, a.metakey AS metakey,
a.created AS created, a.publish_up AS publish_up, a.images AS images,
a.language AS language, a.catid AS catid')
->select($query->concatenate(array('a.introtext', 'a.fulltext')) . ' AS text')
->select('c.title AS section')
->select($case_when)
Expand Down Expand Up @@ -354,7 +356,9 @@ public function onContentSearch($text, $phrase = '', $ordering = '', $areas = nu
$order = ' relevance DESC, ' . $order;
}

$query->select('a.title AS title, a.metadesc, a.metakey, a.created AS created')
$query->select('a.id AS id, a.title AS title, a.metadesc AS metadesc, a.metakey AS metakey,
a.created AS created, a.publish_up AS publish_up, a.images AS images,
a.language AS language, a.catid AS catid')
->select($query->concatenate(array('a.introtext', 'a.fulltext')) . ' AS text')
->select($case_when)
->select($case_when1)
Expand Down