Thank you for your comment. I really appreciate
Sure articles need to be pertinent and content should be more pertinent than rating/view/votes, at least perhaps a sort on the relevance (how much search terms is present in result) might be helpfull, since I have a lot of results matching the same key words.
I was thinking to something like
Code: Select all
SELECT ... MATCH(`subject`,`content`) AGAINST (\''.hesk_dbEscape($query).'\') as relevancy FROM .... WHERE ... AND MATCH(`subject`,`content`) AGAINST (\''.hesk_dbEscape($query).'\') ORDER BY relevancy DESC
Edit: seems that this is the mysql default order when match function is in used.
And if not enough, something like this to add rank based on the title
Code: Select all
SELECT ... MATCH(`subject`,`content`) AGAINST (\''.hesk_dbEscape($query).'\') + MATCH(`subject`) AGAINST (\''.hesk_dbEscape($query).'\') as relevancy FROM .... WHERE ... AND MATCH(`subject`,`content`) AGAINST (\''.hesk_dbEscape($query).'\') ORDER BY relevancy DESC
My original idea, something like this to add order based on the notes
Code: Select all
SELECT ... MATCH(`subject`,`content`) AGAINST (\''.hesk_dbEscape($query).'\')*() as relevancy FROM .... WHERE ... AND MATCH(`subject`,`content`) AGAINST (\''.hesk_dbEscape($query).'\') ORDER BY relevancy DESC, views ASC, rating ASC, votes ASC
Or much more complicated by creating a relevancy factor from the view/rating/votes, but much more complicated and heuristic.