仅当至少X个单词匹配时才选择“全文”

问题描述

SELECT source,id
FROM  memory_row
WHERE memory_id =10

AND MATCH(source) 
AGAINST ('girl*,appears*,cool*,pragmatic*,things*,first*,glance*,actually*,warm*,trusting*,created*,Design*,Children*,Togetsu*,existed*,solely*,activate*,Strings*,experienced*,emotional*,damage*,young*,from*,experiments*,conducted*,her*,cruel*,researchers*,sent*,Randall*,family*,treatment*,after*,sealing*,memories*,small*,world*,older*,adoptive*,sister*,Naomi*')

上面的查询返回的结果中只有几个单词匹配。我只想返回至少包含X个匹配项的结果。在上面的示例中,该数字可以为10。这意味着该列必须至少包含10个全文匹配项才能返回。

我该怎么做?

编辑 一个答案建议如下。我收到错误消息“ AGAINST的参数不正确”。

select m.*
from memory_row m
where 
    memory_id = 10
    and (
        select count(*)
        from (
            select 'girl*' word
            union all select 'appears*'
            union all select 'actually*'
            union all select 'girl*'
            union all select 'cool*'
            union all select 'pragmatic*'
            union all select 'things*'
            union all select 'first*'
            union all select 'glance*'
            union all select 'actually*'
        ) w
        where match(m.source) against(w.word)
    ) >= 5

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)