I want to show result in order that rows have more matches should come on top.
Like if i search for keyword 'abc' in title and content, then it count the total matches for 'abc' in title and content for each row.
Suppose it found
3 matches in 1st row,
5 matches in 2nd row,
2 matches in 3rd row
Then result will show 5 matches row first, after that 3 matches row, and so on in DESC order
I used this query but it didn't sort correct result.
SELECT title, MATCH(title, content) AGAINST ('>("abc def") (abc def) <(abc* def*)' IN BOOLEAN MODE) AS relevance
FROM articles_template
WHERE 1=1
AND MATCH(title, content) AGAINST ('>("abc def") (abc def) <(abc* def*)' IN BOOLEAN MODE)
AND date BETWEEN '2015-02-18 00:00:00' AND '2016-02-18 00:00:00'
ORDER BY relevance DESC
LIMIT 0,10