full text search input rules

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
C_Calav
Forum Contributor
Posts: 395
Joined: Wed Jun 02, 2004 10:55 pm
Location: New Zealand

full text search input rules

Post by C_Calav »

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 :?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

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..
User avatar
C_Calav
Forum Contributor
Posts: 395
Joined: Wed Jun 02, 2004 10:55 pm
Location: New Zealand

Post by C_Calav »

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
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Code: Select all

$query = "SELECT * FROM planes WHERE `P_Desc` LIKE '%$keyword%'";
My stab at it :P
User avatar
C_Calav
Forum Contributor
Posts: 395
Joined: Wed Jun 02, 2004 10:55 pm
Location: New Zealand

Post by C_Calav »

thanx Phenom and feyd will try it out when i get home!
User avatar
C_Calav
Forum Contributor
Posts: 395
Joined: Wed Jun 02, 2004 10:55 pm
Location: New Zealand

Post by C_Calav »

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?
Post Reply