I have this sql query:
SELECT DISTINCT url FROM paragraphs WHERE
MATCH (title) AGAINST('$query') ORDER BY
MATCH (title) AGAINST('$query') DESC
What happens though is when I search, for example, for “john smith” I get “john” “john chambers” …etc. How can I make both words required?
You could add an additional
LIKEclause to your where to filter out all unwanted matches:Thus you have scoring and only the results matching exactly.