繁体   English   中英

PHP MySQL Match()对()全文搜索不适用于某些关键字

[英]PHP MySQL Match() Against() Fulltext search not working for some keywords

我以php开发人员的身份工作,而MySQL全文搜索存在问题。

这是我的查询

select distinct j.jobid,headline,company,country,state,city,location,
date_format(str_to_date(posted_dt, '%m-%d-%Y %H:%i:%s' ), '%M %d, %Y') posted_dt,joblinks 
from jobs j 
left join job_filters jf on jf.jobid = j.jobid 
left join job_emptype_map em on j.jobid = em.jobid 
left join job_sub_emptype_map sem on em.jobid = sem.jobid and em.emp_type = sem.emp_type 
where status=1 
And MATCH (headline,description,pri_skills,company) AGAINST ('java developer' IN natural language MODE) > 1 
And MATCH (location,country,state,city,zipcode,other_loc) AGAINST ('california, United States' WITH QUERY EXPANSION ) > 1 
order by str_to_date(posted_dt,'%m-%d-%Y %H:%i:%s') DESC limit 0,25

通过上述查询,我​​得到了正确的结果。 但这很费力(显示行0-24(共25行,查询耗时50.6951秒。)

当我更改关键字“ ui开发人员”而不是“ java开发人员”时,我得到0个结果

如果我用类似的功能检查关键字“ ui开发人员”,那么我会得到结果。

我不明白为什么匹配功能仅对某些关键字有效,为什么在我的托管计划为云计算时会花费太多时间。

我现在正在使用云服务器计划,并且已使用类似功能更新查询,现在查询是...

select distinct j.jobid,headline,company,country,state,city,location,date_format(str_to_date(posted_dt, '%m-%d-%Y %H:%i:%s' ), '%M %d, %Y') posted_dt,joblinks, (select count(distinct j.jobid) as jobcount from jobs j left join job_filters jf on jf.jobid = j.jobid left join job_emptype_map em on j.jobid = em.jobid left join job_sub_emptype_map sem on em.jobid = sem.jobid and em.emp_type = sem.emp_type where status = 1 and (concat(headline,' ',description,' ',pri_skills,' ',company) like '%java programer%' ) And ( country like '%United States%' ) ) jobcount from jobs j left join job_filters jf on jf.jobid = j.jobid left join job_emptype_map em on j.jobid = em.jobid left join job_sub_emptype_map sem on em.jobid = sem.jobid and em.emp_type = sem.emp_type where status=1 and (concat(headline,' ',description,' ',pri_skills,' ',company) like '%java programer%' )And ( country like '%United States%' ) order by str_to_date(posted_dt,'%m-%d-%Y %H:%i:%s') DESC limit 0,25   

我已经在上面的分页查询之间写了选择查询,上面的查询获得了不错的结果,但是花费了太多时间,请注意:我的工作表有大约50,000+条记录

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM