开发者

MySQL LIKE and MATCH results query

开发者 https://www.devze.com 2023-04-10 18:16 出处:网络
Can开发者_如何学Python someone explain why columnLIKE \'%board%\' returns more results than MATCH (column) AGAINST(\'board\' IN BOOLEAN MODE)

Can开发者_如何学Python someone explain why

column  LIKE '%board%'

returns more results than

MATCH (column) AGAINST('board' IN BOOLEAN MODE)

is it because match against ignores words like 'Blackboard', 'Backboard' etc

Is there away to get MATCH AGAINST return Blackboard, backboard etc?


MATCH (column) AGAINST('keyword... will match against the literal string provided, where as LIKE "%keyword%" will match if a word contains the string provided.


This should do the trick for you:

MATCH (column) AGAINST('board*' IN BOOLEAN MODE)

Source: http://dev.mysql.com/doc/refman/5.5/en/fulltext-boolean.html

There are a lot of good examples of search queries there.

0

精彩评论

暂无评论...
验证码 换一张
取 消