Hi everyone, I have a table ------------------------------------- | name| desc | tag | ------------------------------------- |text1 | Laptop | Laptop | -------------------------------------- |text2 |Laptop Battery|Laptop Battery| I have this query: SELECT *, MATCH (`tag`,`desc`) AGAINST ('laptop' IN BOOLEAN MODE) as score FROM test WHERE MATCH (`tag`,`desc`) AGAINST ('laptop' IN BOOLEAN MODE) ORDER BY score I want to make an order of results , but first results should come with word "laptop" in tag field , so I dont want to see in first position Laptop Battery on search results. but if the search term will be "laptop battery| than order should start with Laptop battery.
You are doing Full-Text search and it's up to MySQL to decide which rows match the best but if you want to do that, use a select statement before this query and then append the result to your search result: SELECT * FROM test WHERE tag = 'laptop';