fulltext search results
i m using this below code to search fulltext
Product name is
$sql = "SELECT product_name FROM product_table WHERE MATCH (product_name) AGAINST ('+".$item_name."' IN BOOLEAN MODE)";
If i write "Nokia" in search box then this product name is shown.
If i write "5800" in search box then also this product name is shown.
But if i write 'Nokia 5800" in search box then this product name is not shown.
I can't replicate your findings. However, " +'Nokia 5800' " means " find rows that contain the word 'Nokia', but rank rows higher if they also contain '5800' "
To find an exact phrase, you'd need to wrap the phrase in qutoation marks - which might look like this...
Note that I've rewritten the query so you can see the actual score returned by each result!
$sql = "SELECT product_name,MATCH (product_name) AGAINST ('+\"".$item_name."\"' IN BOOLEAN MODE) score FROM product_table ";