Jump to content

[SOLVED] MATCH / AGAINS non exact match?! (not fulltext error :P)


Recommended Posts

Hey guys,

Im having a litle problem with a query, I was reading about searching in multiple field with non exact match and the query should look like this in FULLTEXT

 

$sql = "SELECT * FROM Comment WHERE MATCH(CommSubject, CommText, PartCountry, PartCity)  AGAINST ('".$searchstring."') ORDER BY CommDT DESC";

 

The thing is I dont want the user to use boolean expression is the look for lets say

Sold

insteed of

Soldier

 

but if I try it with only sold, I get no query result. Does anyone have an idea what is wrong with it ?

 

Thanks in advance.

Sorry I found it, just had to use boolean but add my own operator ... duh.

 

$sql = "SELECT * FROM Comment WHERE MATCH(CommSubject, CommText, PartCountry, PartCity)  AGAINST ('*".$searchstring."*' IN BOOLEAN MODE) ORDER BY CommDT DESC";

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.