【发布时间】:2014-08-09 12:17:20
【问题描述】:
我试图在给定文本中突出显示最多 2 个单词。搜索关键字来自具有数百个可能匹配项和重要性信息的 mysql 表。
例如:“疯狂的狐狸跳过红牛”
可能匹配的mysql表“单词”:
keyword importance
bird 0,2
fox 0,5
cow 0,1
red 0,4
查询应该返回 fox 和 red。
类似这样的:
SELECT keyword
from db.words
WHERE keyword matches ('The cracy fox jumps over the red cow')
ORDER BY importance
LIMIT 2
感谢您提供有关如何实现此目的的任何提示!
【问题讨论】:
标签: php mysql sql full-text-search