开发者

Simplifying mysql fulltext search

To do text search for wordA, wordB and wordC right now I'm doing it this way:

SELECT * FROM 
    mytable 
WHERE
    MATCH (field1) AGAINST ('wordA' IN BO开发者_开发百科OLEAN MODE) OR
    MATCH (field1) AGAINST ('wordB' IN BOOLEAN MODE) OR
    MATCH (field1) AGAINST ('wordC' IN BOOLEAN MODE)

Is there a more compact way of writing this?


Just worked out this will work too

SELECT * FROM 
    mytable 
WHERE
    MATCH (field1) AGAINST ('wordA/wordB/wordC' IN BOOLEAN MODE)
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜