Sort search results by search score?

Permalink 1 user found helpful
Is it possible to sort the search results by the reulsts score rather than the date. Currently if I search for a term using the full page index in the dashboard and sort by score the most relavent pages are top. If I search for the same term on the site however the pages appear to be in date order pushing more relavent pages down the list.


View Replies: View Best Answer
andrew replied on at Permalink Best Answer Reply
Yes, although this does require touching code.

1. Copy concrete/blocks/search/controller.php into a new folder blocks/search/controller.php (in the empty blocks/ directory).
2. Edit controller.php. Delete the line that says


3. In its place, put the line


That should do it.

NOTE: this makes use of the MySQL Fulltext index. If you don't tune the "stop words" for this index some searching can be really crappy. (e.g. currently "about" is in the stop words list so if you search for about you won't find anything. Lame.)
Cravener replied on at Permalink Reply
will cause of MySQL query error if "Search block" used as "Blog Archive" list.
digirunt replied on at Permalink Reply
Thanks for that, that's sorted it.
I'll take a look at my stop words as I've ran into issues there before.
andrew replied on at Permalink Reply
Cool. Yeah the only reason I mention stop words is because I try to search for "About" every single time when testing stuff like this and am perplexed – until I remember its on that list by default.