By User on Monday, 01 July 2019
Posted in EasySocial
Replies 5
Likes 0
Views 669
Votes 0
Hello.
Hello, I would like to know how does search works now? In what order it show results (as default)? By "latest"? Thanks.


Another way is to move this ticket to feature request section:
When user seach for something (for example "food" in "videos") it would be great also to filter (sort) results:
1) latest (newest)
2) most popular (by views)
3) most reacted
4) most commented
7) alphabetic


Thanks.
Hello. People say, in file:
.../components/com_finder/models/search.php
there is another line:

$order = $input->getWord('filter_order', $params->get('sort_order', 'relevance'));
that try to read filter_order parameter. If there is no filter_order, system try to find sort_order in component or menu item item settings.

Original Smart Search (com_finder) component has Sort Field option (Date, Relevance, List price).

Original Smart search Menu Item also has some filters.


But EasySocial's (Search) Basic Search Layout doesn't has something similar 😩

Can you please help to edit this file to sort items by date or id?
Thanks.


UPDATED: edit file in Joomla .../components/com_finder/models/search.php
this line:
$order = $input->getWord('filter_order', $params->get('sort_order', 'relevance'));

to
$order = $input->getWord('filter_order', $params->get('sort_order', 'l.start_date'));

and seems it works – now items sorted by date.
Please don't close the topic.

Or file in Joomla 4 ...components/com_finder/src/Model
$order = $input->getWord('o', $params->get('sort_order', 'date'));
·
Thursday, 13 October 2022 02:48
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Dmitry,

The sorting for search actually according to alphabetically currently. And yes, there is no sorting option for the search at this point of time. As per request, I have moved this ticket under feature request

Thanks for your cooperation and understanding Dmitry
·
Monday, 01 July 2019 13:45
·
0 Likes
·
0 Votes
·
0 Comments
·
The sorting for search actually according to alphabetically currently.
Hi. Do you know what file should be edited to sort items in search results by "Latest"? Thanks.
·
Tuesday, 02 July 2019 00:45
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Dmitry,

The sorting is done in the com_finder which is from Joomla, which is in the file:
.../components/com_finder/models/search.php in function getResultsData
·
Tuesday, 02 July 2019 13:47
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for sharing.
·
Friday, 14 October 2022 09:46
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post