bigbrennan Posted August 17, 2007 Share Posted August 17, 2007 Hi, We have a PHP search function our site which searches various MySQL fields. Our problem is this - If you search for the word 'IT', the results shown will include any records with words such as 'with','british' because these contain the letters 'it'. Is there a way we can tell the script to ignore keywords with letters around them, example: Show anything with IT Do not show anything with *IT* * = wild card Any help and assistance would be greatly appreciated. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/65390-php-search-function-individual-keywords-appearing-in-larger-words/ Share on other sites More sharing options...
Barand Posted August 17, 2007 Share Posted August 17, 2007 Are you searching column containing a ) a single word b ) several keywords (how separated?) c ) sentences d ) other Are you searching using i ) WHERE col LIKE 'x' ii ) fulltext iii) other Quote Link to comment https://forums.phpfreaks.com/topic/65390-php-search-function-individual-keywords-appearing-in-larger-words/#findComment-326534 Share on other sites More sharing options...
bigbrennan Posted August 17, 2007 Author Share Posted August 17, 2007 Thanks for the quick response. The column's contain sentences. For example it would contain the work expereince section of your CV. It searches using: fulltext and regex (regular expression). Quote Link to comment https://forums.phpfreaks.com/topic/65390-php-search-function-individual-keywords-appearing-in-larger-words/#findComment-326541 Share on other sites More sharing options...
Barand Posted August 17, 2007 Share Posted August 17, 2007 I thought that you had to explicitly provide the "*" wildcard to make fulltext pull words containing the keyword Quote Link to comment https://forums.phpfreaks.com/topic/65390-php-search-function-individual-keywords-appearing-in-larger-words/#findComment-326544 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.