我有以下 MySQL 查询:
SELECT title, description
FROM some_table
WHERE MATCH (title,description) AGAINST ( +denver (REGEXP "[[:<:]]colorado[s]*[[:>:]]") IN BOOLEAN MODE);
这里的“ regexm” 寻找一个“ 完整的单词” 色度( 包含或不包含结尾的“ s ” ) 。
我想实际上只选择那些有(“ denver” ) 和( “ 彩虹” 或“ 彩虹 ” ) 的行。 但我不能为 REGEXP 设置“ + ” 。 我尝试过,但结果为零,尽管表格中有符合要求的行。
Any ideas on how I can get the "+" to work within against using a REGEXP? I am constructing this from within a PHP script where "denver" and "colorado" are values of variables I use to construct the select statement.
我的PHP/ MySQL 脚本看起来会有点像 :
SELECT title, description
FROM some_table
WHERE MATCH (title,description) AGAINST ( +$var1 (REGEXP "[[:<:]]$var2[s]*[[:>:]]") IN BOOLEAN MODE);