簡體   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