mysql[fulltext search]- show search term used to get that particular result -


for like search do-

select name,"term1" searchterm articles name "%term1%" union select name,"term2" searchterm articles name "%term2%"` 

how term used particular result in or search fulltext search? there way -

select name,searchterm articles match (name)  against ('term1 term2' in boolean mode); 

try (it tested on local , working):

select     tmp1.msg,     tmp2.tag_name (     select          convert(name using utf8) msg               `articles`               match(`name`) against ('term1 term2' in boolean mode) ) tmp1 inner join (     select convert('term1' using utf8) tag_name     union     select convert('term2' using utf8) tag_name       ) tmp2     on tmp1.msg concat('%',tmp2.tag_name,'%') 

Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -