我正在使用以下查询来搜索文本,
$query = "SELECT SQL_CALC_FOUND_ROWS *," .
"MATCH (keywords) AGAINST ('". $searchString ."'IN BOOLEAN MODE ) AS rel1, ".
"MATCH (title) AGAINST ('". $searchString ." 'IN BOOLEAN MODE ) AS rel2, ".
"MATCH (description) AGAINST ('". $searchString ." 'IN BOOLEAN MODE) AS rel3 ".
"WHERE MATCH (keywords,title,description) AGAINST ('" .$searchString. "' IN BOOLEAN MODE) " .
"FROM cron_video " .
"ORDER BY (rel1*1.5)+(rel2*1.25)+(rel3*1) desc, `cron_status` ASC LIMIT $start, $pagesize";
但是,下面的搜索查询id
给出了 BigInt 类型的错误。
$query = "SELECT SQL_CALC_FOUND_ROWS *," .
"MATCH (id) AGAINST ('*". $searchString ."*' IN BOOLEAN MODE ) AS rel1," .
"FROM cron_video " .
"WHERE MATCH (id) AGAINST ('*" .$searchString. "*' IN BOOLEAN MODE) AS rel2" .
"ORDER BY (rel1*1.5)+(rel2) desc, `cron_status` ASC LIMIT $start, $pagesize";
我的疑问:
1. BigInt 类型是否可以进行全文搜索。
关于第一个查询:
- 我不确定我可以为相关因子(即)1.5(rel1*1.5)、(rel2*1.25)、rel3 等给出什么值......这个值本身是否足够,或者我如何确定最佳相关因子。
- 有什么方法可以优化第一个查询。