Jump to content

Using Match Against to provide the "best match"/best results


oz11

Recommended Posts

I'm trying to get this query to list the results in an order that when searching using two terms, the response will be that those at the top are the "best match". For example, the query for 'google news' , at the moment, does not return Google to the top but actually other keyword/rows containing "news". See, Google is at the bottom when i would like it to be near the top, as its a "better match" then the others. Help me with this head scratching situation people please..

SELECT * FROM links, link_word, keywords WHERE links.link_id = link_word.link_id AND link_word.key_id = keywords.key_id AND MATCH(word) AGAINST('google news') OR MATCH(title) Against('"-google news"') GROUP BY title

1291682097_Screenshotfrom2022-09-1400-43-53.thumb.png.b9efa2bf5d8ceea80327087005f17b0f.png

 

1229514402_Screenshotfrom2022-09-1400-43-31.thumb.png.9c8f56fb046bf86edf4d5310f8d81bc0.png

 

thanks, 

  Oz.  

Link to comment
Share on other sites

Quick update. I swapped the database around and changed the query abit. Still have the same problem though. :S

 

SELECT * FROM links, bridge, keywords WHERE links.links_id = bridge.link_id AND bridge.keyw_id = keywords.keyw_id AND MATCH(description) AGAINST('google news') AND MATCH(terms) AGAINST('google NEWS') OR MATCH(title) AGAINST('google NEWS') GROUP BY title

 

New screenshot:

629862864_Screenshotfrom2022-09-1401-50-06.thumb.png.e9b195146bb41df15bc756fe4b8d1ba6.png

Edited by oz11
Link to comment
Share on other sites

  • 3 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.