简体   繁体   中英

mysql fulltext search any string

*I want to select all rows which contain a specific search string (1 to 20 chars) in my name column of my projects table.

The table type is MYISAM and i created a FULLTEXT index on the name column.

Now my question is, how can I say that i want to find the string whereever it occurs in the column (as like "LIKE %...%"), but just with a fulltext searchquery.

My current try is this:

SELECT * FROM projects WHERE MATCH(name) AGAINST ('+search' IN BOOLEAN MOE)

But this does not work, it returns only columns which only contain the whole string and nothing else.

Thank you in advance for your help.

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

HAVING RELEVANCE > ...

You can work with your data and determine the right amount (somewhere less than 1). Good luck.

尝试这个

SELECT * FROM projects WHERE MATCH(name) AGAINST ('search')

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM