Jump to content

Order Results By Relevance


The Little Guy

Recommended Posts

I have this search query (works):

$query = "SELECT SQL_CALC_FOUND_ROWS
*
FROM lyrics
WHERE
MATCH(lyric,title,album,artist) AGAINST ('%$q%' IN BOOLEAN MODE)
LIMIT $limitvalue, $limit";

 

I want to modify the query, so the more relevant results are first, and less relevant results are last. but I would like the weight to be like this:

-title

-artist

-album

-lyric

 

by weight I mean relevance. 100% weighs more than 20% relevance.

Link to comment
https://forums.phpfreaks.com/topic/109407-order-results-by-relevance/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.