Suchy Posted March 2, 2009 Share Posted March 2, 2009 I am having a problem with my search results, I am getting too many. SELECT first, last, job FROM people WHERE MATCH (first, last) AGAINST ('John Smith' IN BOOLEAN MODE) ORDER BY id I am getting everyone who has the first or last name John and everyone who has the first or last name is Smith. How should this query look so that I am only getting results whose first and last is what I search for? Link to comment https://forums.phpfreaks.com/topic/147608-searching-for-full-name/ Share on other sites More sharing options...
fenway Posted March 3, 2009 Share Posted March 3, 2009 Why boolean mode? Link to comment https://forums.phpfreaks.com/topic/147608-searching-for-full-name/#findComment-775347 Share on other sites More sharing options...
Suchy Posted March 3, 2009 Author Share Posted March 3, 2009 Because without it the search does not work at all. With $10 a year for hosting, you get what you pay for. Link to comment https://forums.phpfreaks.com/topic/147608-searching-for-full-name/#findComment-775518 Share on other sites More sharing options...
fenway Posted March 4, 2009 Share Posted March 4, 2009 Hmm, i think you need double-quotes to search for it as a phrase.... Yes, but that's not the point, since it's over two columns... use '+John +Smith' instead. Link to comment https://forums.phpfreaks.com/topic/147608-searching-for-full-name/#findComment-776200 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.