I am writing to you because I would like to make a query in MySQL giving priority to a LIKE. eg: I have a search engine where they put "Old House" ... and I search in the fields subject, document and number the words "old house", "house" and "old" without an ORDER BY
What I want to achieve is to order the query that first shows me the coincidence in "Old house" then those of "home" and then those of "old", can it be done in a query?
Example of the query I do in this case:
SELECT * FROM documentos WHERE (tema LIKE '%Casa vieja%' OR documento LIKE
'%Casa vieja%' OR numero LIKE '%Casa vieja%' OR tema LIKE '%Casa%' OR
documento LIKE '%Casa%' OR numero LIKE '%Casa%' OR tema LIKE '%vieja%' OR
documento LIKE '%vieja%' OR numero LIKE '%vieja%' )
Thank you very much