By Terry Bjork on Tuesday, 20 November 2018
Posted in General
Likes 0
Views 573
Votes 0
Hello

I could not find this mentioned in doc or previous issues. Must be a common question though.

Client would like blog search results to appear in order of descending date. Not entirely sure what the order is now but date it is not.

I cannot find a setting for that in Easyblog component or plugin or even modules, or Joomla search. It does not look to be something a template override could accomplish - EB search code all looks to be in administrator component model(?) and does not seem to have consideration to accept something like adding $query->order('ordering DESC') to module override.

Is there any way I can deliver this without hacking your component code? Probably missing something simple.

Thanks.
Hey there,

I am really sorry for the delay of this reply as it is a public holiday for us here.

The current search result is actually sorted by score (title, intro and content), if the search query match with the blog title, it will put the high score.

If you would like to sort by descending, you have to modify this file
Joomlafolder/administrator/components/com_easyblog/models/search.php at line 249 replace with this code


$query .= ' ORDER BY x.`publish_up` DESC, x.`score` DESC';


This query will sort it as the latest first and followed with likeness if the date is the same.
·
Tuesday, 20 November 2018 10:09
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks that mod worked.
·
Friday, 30 November 2018 02:15
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi there,

You are most welcome. Glad to hear that your issue has been resolved now.

Just for your information, I have locked and marked this thread as resolved to avoid confusions in the future. Please start a new thread if you have any other issue in the future so it will be easier for us to manage your inquiries.

Thanks for understanding.
·
Friday, 30 November 2018 10:11
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post