I'm trying to get the books whose titles contain what the user enters.
Assuming I have the following books:
- Trees
- Planes
- There was once trus
Assuming that the user entered the letter a
, before resolving it using the following query:
SELECT title
FROM Books
WHERE title LIKE "%a%";
Which returned all the books to me.
Then, investigating, I found that the function Match Against
is much faster than like
so I tried to migrate it, but to my surprise when I do the query:
SELECT title
FROM Books
WHERE MATCH (title) AGAINST ('a' IN BOOLEAN MODE);
It does not return anything, since it does not contain the complete phrase a
. I tried without success with the query:
SELECT title
FROM Books
WHERE MATCH (title) AGAINST ('*a*' IN BOOLEAN MODE);
Is there a way to get the books back when the title contains the phrase, either exactly or not?
Thank you very much already.