- $search_cond = "(title LIKE '%$search_query%'
- OR description LIKE '%$search_query%'
- OR tags LIKE '%$search_query%')";
- $relevance = "( 0.5 * (title LIKE '%git%')
- + 0.2 * (description LIKE '%git%')
- + 0.3 * (tags LIKE '%git%') ) AS relevance";
+ $sfc .= "(title LIKE '%$fragm%'
+ OR description LIKE '%$fragm%'
+ OR tags LIKE '%$fragm%') OR ";
+
+ // Frament relevations are half of boolean relevations such
+ // that they will appear at the end of the results.
+ $sfr .= "0.25 * (title LIKE '%$fragm%')
+ + 0.1 * (description LIKE '%$fragm%')
+ + 0.15 * (tags LIKE '%$fragm%') + ";
+
+ $fragm = strtok($sep);