Gossamer Forum
Home : Products : DBMan : Customization :

City abbreviation?

Quote Reply
City abbreviation?
My database is searched by City and State. Unfortunately, some cities are correct with 'St. Louis' and 'Saint Louis', or 'Ft. Lauderdale' and 'Fort Lauderdale'. Would there be a way to customize the database so that when someone searches for the abbreviated city (St., Ft.), they would still find the other (Saint, Fort)?

Quote Reply
Re: City abbreviation? In reply to
If your searching is NOT set to exact match, either St. Louis or Saint Louis should yield a result with Louis in it.

Another way would be to have a drop down list of cities. Gets rid of any spelling issues.

Quote Reply
Re: [brolston] City abbreviation? In reply to
Old thread, but I thought someone might be searching the forums for this like I was recently... I used this code and it seems to work okay. In db.cgi, sub query, right after local (%sortby):

if ($in{'keyword'} eq "st") {

($in{'keyword'} = "St.")

}

else ($in{'keyword'} eq "saint") {

($in{'keyword'} = "St.")

}



St. is what is in the db file. the st and saint are the variations users might be typing in. keyword I think would make this include all fields, but one could change keyword to "city" if one only wanted it to apply to a field called "city"