Skip to Main Content

Prioritize catsearch results

user7440674Jul 13 2010 — edited Jul 20 2010
Does anyone have a clever way to prioritize (order) the result set of a catsearch query such that the "best" matches rise to the top? For example, I'm querying a large table of street names using SELECT st_name as name FROM street_names WHERE catsearch(st_name, 'Oak St', null) > 0;

This results in 87 matches, with "Oak St" (the one I'm most likely looking for) no better than the 50th row in the result set. Since it is an exact match, I'd like it to be the first row, with other variations in decreasing order of "matchiness". Any suggestions appreciated.
Comments
Post Details
Added on Jul 13 2010
1 comment
921 views