Php 对文本的搜索索引比你的OR链更模糊。因此,您的部分查询如下所示: SELECT name, MATCH(name) AGAINST ('Hello this is me') as confidence FROM user_primary WHERE MATCH(name) AGAINST ('Hello this is me') ORDER BY confidence DESC
比赛越好,信心越高,所以“你好,这是我”应该排在首位 这可能是您的查询,已清理且未经测试:Php 对文本的搜索索引比你的OR链更模糊。因此,您的部分查询如下所示: SELECT name, MATCH(name) AGAINST ('Hello this is me') as confidence FROM user_primary WHERE MATCH(name) AGAINST ('Hello this is me') ORDER BY confidence DESC,php,mysql,sql,database,Php,Mysql,Sql,Database,比赛越好,信心越高,所以“你好,这是我”应该排在首位 这可能是您的查询,已清理且未经测试: select distinct(user_primary.id) as id , MATCH(name) AGAINST ('Hello this is me') as confidence from user_primary, user_sec, user_location, user_ind_cat WHERE user_primary.status != 3 and user_primar
select distinct(user_primary.id) as id , MATCH(name) AGAINST ('Hello this is me') as confidence
from user_primary, user_sec, user_location, user_ind_cat
WHERE
user_primary.status != 3
and user_primary.id = user_sec.job_id
and user_primary.id = user_ind_cat.job_id
and MATCH(name) AGAINST ('Hello this is me')
and user_primary.login <= 1415426357
ORDER BY confidence DESC
limit 0, 150
选择distinct(user_primary.id)作为id,将(name)与('Hello this is me')匹配作为置信度
来自用户\主、用户\秒、用户\位置、用户\标识\类别
哪里
用户_primary.status!=3.
而user_primary.id=user_sec.job_id
用户_primary.id=用户_ind_cat.job_id
并将(姓名)与(‘你好,这是我’)
而user_primary.login是您的搜索标记根本没有显示,还是只是没有显示在结果列表的顶部?@Benni它没有显示在结果列表的顶部。从查询中删除表user_Location
,它没有被使用或加入…是部分和(user_primary.name,如“%Hello this Is me%”)
真的与和
有联系吗?也不是或
?删除用户位置
不会给出解决方案。除此之外,该查询是动态生成的,这意味着在某个时刻,应用程序将创建一个查询以加入用户位置
。您的搜索标记是根本没有显示,还是只是没有显示在结果列表的顶部?@Benni它没有显示在结果列表的顶部。从查询中删除表用户位置
,它没有被使用或连接…部分和(像“%Hello this is me%”这样的user_primary.name
是否真的与和连接?也不是或
?删除用户位置
不会给出解决方案。除此之外,该查询是动态生成的,这意味着在某个时刻,应用程序将创建一个查询以加入用户位置
。您的搜索标记是根本没有显示,还是只是没有显示在结果列表的顶部?@Benni它没有显示在结果列表的顶部。从查询中删除表用户位置
,它没有被使用或连接…部分和(像“%Hello this is me%”这样的user_primary.name
是否真的与和连接?也不是或
?删除用户位置
不会给出解决方案。除此之外,该查询是动态生成的,这意味着在某个时刻,应用程序将创建一个查询以加入用户位置
。您的搜索标记是根本没有显示,还是只是没有显示在结果列表的顶部?@Benni它没有显示在结果列表的顶部。从查询中删除表用户位置
,它没有被使用或连接…部分和(像“%Hello this is me%”这样的user_primary.name
是否真的与和连接?也不是或
?删除用户位置
不会给出解决方案。此外,此查询是动态生成的,这意味着在某些情况下,应用程序将创建一个用于加入user\u location
的查询。非常好的解决方案谢谢。如果OP回答了问题,我希望OP会回来并将其标记为“已回答”。@mainstreet标记我正忙于其他问题,这就是为什么我没有看到这个。很好。非常好的解决方案谢谢。如果OP回答了问题,我希望OP会回来并将其标记为“已回答”。@mainstreet标记我正忙于其他问题,这就是为什么我没有看到这个。很好。非常好的解决方案谢谢。如果OP回答了问题,我希望OP会回来并将其标记为“已回答”。@mainstreet标记我正忙于其他问题,这就是为什么我没有看到这个。很好。非常好的解决方案谢谢。如果OP回答了问题,我希望OP能回来并将其标记为“已回答”。@mainstreetmark我正忙于其他问题,这就是为什么我没有看到这一点。
ALTER TABLE `user_primary` ADD FULLTEXT INDEX (`name`);
SELECT name, MATCH(name) AGAINST ('Hello this is me') as confidence
FROM user_primary
WHERE MATCH(name) AGAINST ('Hello this is me')
ORDER BY confidence DESC
select distinct(user_primary.id) as id , MATCH(name) AGAINST ('Hello this is me') as confidence
from user_primary, user_sec, user_location, user_ind_cat
WHERE
user_primary.status != 3
and user_primary.id = user_sec.job_id
and user_primary.id = user_ind_cat.job_id
and MATCH(name) AGAINST ('Hello this is me')
and user_primary.login <= 1415426357
ORDER BY confidence DESC
limit 0, 150