【发布时间】:2011-10-16 07:53:02
【问题描述】:
使用 mysql 的搜索结果,如何使用 php 对结果进行排序以首先显示最接近的匹配项?
即用户搜索“关键字”,我有 50 个结果,其中包含来自数据库中不同表和字段的“关键字”。他们都匹配。我想首先显示完全匹配“关键字”的结果,然后显示其他匹配项:
1 = "keyword in this result"
2 = "keyword in 10th result"
3 = "keywords in 5th result"
4 = "has keyword in 3rd result"
5 = "this has the keyword in the 8th result"
6 = "this has mykeyword in the 40th result"
【问题讨论】:
标签: php mysql sorting search-engine