I'm trying to work on a orderly display of my search results here
When user does a search on "3mm crack" the results would be displayed in such a way
Records with "3mm crack" would be displayed first, followed by all the "3mm" records or "crack" records
It would give priority to the most matches that is to say
the results should also display all the "3mm" records orderly, together that is and not scattered
$queryKeyword .= " and AircraftTailNo REGEXP '[[:<:]]{$trimmedKeyword}[[:>:]]' OR DefectInfo REGEXP '[[:<:]]{$trimmedKeyword}[[:>:]]' OR Rectifications REGEXP '[[:<:]]{$trimmedKeyword}[[:>:]]' OR Comments REGEXP '[[:<:]]{$trimmedKeyword}[[:>:]]' OR RelatedDoc REGEXP '[[:<:]]{$trimmedKeyword}[[:>:]]' order by DefectInfo Desc";
The query displayed when "3mm crack" is being searched
SELECT * FROM report WHERE 1 and AircraftTailNo REGEXP '[[:<:]]3mm[[:>:]]' OR DefectInfo REGEXP '[[:<:]]3mm[[:>:]]' OR Rectifications REGEXP '[[:<:]]3mm[[:>:]]' OR Comments REGEXP '[[:<:]]3mm[[:>:]]' OR RelatedDoc REGEXP '[[:<:]]3mm[[:>:]]' order by DefectInfo Desc
SELECT * FROM report WHERE 1 and AircraftTailNo REGEXP '[[:<:]]crack[[:>:]]' OR DefectInfo REGEXP '[[:<:]]crack[[:>:]]' OR Rectifications REGEXP '[[:<:]]crack[[:>:]]' OR Comments REGEXP '[[:<:]]crack[[:>:]]' OR RelatedDoc REGEXP '[[:<:]]crack[[:>:]]' order by DefectInfo Desc