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")
Please see this: http://goo.gl/lZIKBk at 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".
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.