dimanche 4 septembre 2016

mysql match against exact phrase doesn't work

I'm trying to find an exact phrase but for some reason, it finds matches with additional words , here is the code :

$subLocationId = DB::select( 

DB::raw(' SELECT id  FROM sub_location WHERE match(sub_location_name) against("' .
    $subLocationName . '" IN BOOLEAN MODE ) ' )

);

above is Laravel ORM query , and here is regular mysql:

' SELECT id  FROM sub_location WHERE match(sub_location_name) 
  against("' .$subLocationName . '" IN BOOLEAN MODE ) '

I input : "Business Bay" but it matches "53 Business Bay" , I'd like it to match only "Business Bay" without any extra word from front or behind



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire