Reputation: 11
i am building a laravel project search field where i use a full-text search. I have managed to get this to work, but i cannot get multiple keywords to search together.
example:
i have a row with a value of one two three four
if i search two three
it finds all entries with either two
or three
in them. But i want it to find the entry with both two
and three
SQL query:
DB::raw("select id, name, text, image, publishDate from game
where match (name) AGAINST ('*$searchphrase*' IN BOOLEAN MODE) LIMIT 5")
Upvotes: 1
Views: 1378
Reputation: 1946
Please see this: https://dev.mysql.com/doc/refman/5.5/en/fulltext-boolean.html
"+" stands for AND
"-" stands for NOT
[no operator] implies OR
You don't have any operator which implied "OR".
Upvotes: 0