Give an example of Boolean mode fulltext searchSolutionthis
Give an example of Boolean mode full-text search.
Solution
this programm example shows you how to search for a product whose product name contains the herohonda bike.
open my sql database and run following command
1 SELECT bikeName, bikecompany
2 FROM bikes
3 WHERE MATCH (bikename)
4 AGAINST(\'bike\' IN BOOLEAN MODE )
the database mysql find the record and display you record of bike contain ok
this program query contain the Bike word but not any rows that contain bike _company,
you can use the exclude Boolean operator ( - ),
which returns the result that excludes the bike _company keyword as the following query:
1 SELECT bikeName, bikecompany
2 FROM bikes
3 FROM products
4 WHERE MATCH(bikename) AGAINST (\'bike -bikecompany\' IN BOOLEAN MODE )
mysql have many boolean full text search operators some example are given below to find out against Boolean
+ Include, the word must be present.
~ Negate a word’s ranking value.
* Wildcard at the end of the word.
“” Defines a
> Include, and increase ranking value.
< Include, and decrease the ranking value.
() Group words into sub expressions
