Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
C_Calav
Forum Contributor
Posts: 395 Joined: Wed Jun 02, 2004 10:55 pm
Location: New Zealand
Post
by C_Calav » Mon Jan 31, 2005 1:37 am
ok i have been reading the mysql manual. now how can i set my seach to a minium of 2 characters instead of 3?
plus, am i able to search just part of a word?
put "pen" in and get the result back oin my search of "pencil"
thanx guys. ps may want to move thread as i have edited it
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Mon Jan 31, 2005 7:16 am
as far as I know, you cannot change the default search to lower than 3 characters. This is most likely because of the shear number of instances where those letters would occur, and thus would be removed from the results.
at the least, you can use the LIKE wildcards to find pencil when searching against pen. Since I haven't really fiddled with full-text searches, query expansion may do sort of the same thing..
C_Calav
Forum Contributor
Posts: 395 Joined: Wed Jun 02, 2004 10:55 pm
Location: New Zealand
Post
by C_Calav » Mon Jan 31, 2005 3:42 pm
thanx feyd, how would i incorperate "LIKE" into my querry?
is it possible top have match and like in the same queery?
Code: Select all
$query = "SELECT * FROM planes WHERE MATCH (P_Desc) AGAINST ('$keyword') ";
thanx
John Cartwright
Site Admin
Posts: 11470 Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:
Post
by John Cartwright » Mon Jan 31, 2005 3:47 pm
Code: Select all
$query = "SELECT * FROM planes WHERE `P_Desc` LIKE '%$keyword%'";
My stab at it
C_Calav
Forum Contributor
Posts: 395 Joined: Wed Jun 02, 2004 10:55 pm
Location: New Zealand
Post
by C_Calav » Mon Jan 31, 2005 6:59 pm
thanx Phenom and feyd will try it out when i get home!
C_Calav
Forum Contributor
Posts: 395 Joined: Wed Jun 02, 2004 10:55 pm
Location: New Zealand
Post
by C_Calav » Thu Feb 03, 2005 7:24 pm
this does not seem to bring any results back from the database!
Code: Select all
$query = "SELECT * FROM planes WHERE `P_Desc` LIKE '%$keyword%'";
does anyone else have any clue on how to do full text search on part of a word?