Problem with MySQL Full-Text Search
-
I am using the following statement:
SELECT * FROM patients WHERE MATCH(full_name) AGAINST('jassim ali' WITH QUERY EXPANSION) ORDER BY full_name;
what I want to display all records contains jassim and should also contains ali but getting totally different result! here are names I am getting in the result:
Abdul Rahma Salma
Ali Jassim
Jassim Rahma
Jassim Rahma
Mohd Ali Ahmed
Mohd Jassim Maki -
I am using the following statement:
SELECT * FROM patients WHERE MATCH(full_name) AGAINST('jassim ali' WITH QUERY EXPANSION) ORDER BY full_name;
what I want to display all records contains jassim and should also contains ali but getting totally different result! here are names I am getting in the result:
Abdul Rahma Salma
Ali Jassim
Jassim Rahma
Jassim Rahma
Mohd Ali Ahmed
Mohd Jassim MakiNever tried that. But I guess, and
AND
with two clauses could do the trick:SELECT *
FROM patients
WHERE MATCH(full_name) AGAINST('jassim' WITH QUERY EXPANSION)
AND MATCH(full_name) AGAINST('ali' WITH QUERY EXPANSION)
ORDER BY full_name;Please try, and report failure or success.
-
Never tried that. But I guess, and
AND
with two clauses could do the trick:SELECT *
FROM patients
WHERE MATCH(full_name) AGAINST('jassim' WITH QUERY EXPANSION)
AND MATCH(full_name) AGAINST('ali' WITH QUERY EXPANSION)
ORDER BY full_name;Please try, and report failure or success.
I tried it but still the same problem. I am getting result which has no relation to the string entered! here is my result:
Abdul Rahma Salma
Ali Jassim
Jassim Rahma
Jassim Rahma
Mohd Jassim Makibecause it's returning Jassim OR Rahma but I want Jassim AND Rahma