我在这里设置示例代码
http://sqlfiddle.com/#!2/6aa9ec/1
Below mentioned DB query used for searching the word Samsung but its not working
SELECT `idREQUEST`, `USER_NAME`, `idCATEGORY`, `TITLE`, `DESCRIPTION`, `IMAGE_URL1`, `IMAGE_URL2`, `IMAGE_URL3`, `POST_DATE`
FROM `requests`
WHERE MATCH (`TITLE`,`DESCRIPTION`) AGAINST('Samsung')
最佳答案
您可以使用Boolean Full-Text Searches
SELECT `idREQUEST`,
`USER_NAME`,
`idCATEGORY`,
`TITLE`,
`DESCRIPTION`,
`IMAGE_URL1`,
`IMAGE_URL2`,
`IMAGE_URL3`,
`POST_DATE`
FROM `requests`
WHERE MATCH (`TITLE`,`DESCRIPTION`) AGAINST('+Samsung' IN BOOLEAN MODE)
According to docs
MySQL can perform boolean full-text searches using the IN BOOLEAN MODE modifier. With this modifier, certain characters have special meaning at the beginning or end of words in the search string. In the following query, the + operator indicate that a word is required to be present, respectively, for a match to occur.
关于MySql 完整索引搜索不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26628814/