Jump to content

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


thryb

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";

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.