I'm going through merging the 0.8.0 release with my code base and came upon
MySQLLikeSearch.  I'd like to offer an alternative method.

Firstly, making this a server config option kinda sucks. Why not let the
user choose?  Throw a checkbox on the search page that allows someone to
designate their search as wildcarded.  If you want to, you can make the
appearance of that box a server config option.  It can be frustrating both
when you want a wildcarded search and can't get one and when you get a
wildcarded search and don't want one.

Secondly, you can do wildcarded fulltext searches. See
http://dev.mysql.com/doc/refman/5.0/en/fulltext-boolean.html
for instance,
SELECT * FROM notice WHERE (MATCH(content) AGAINST  ('junk*' IN BOOLEAN
MODE) );
to match a notice with junkie or junker in it.

or
SELECT * FROM profile WHERE ( MATCH(nickname, fullname, location, bio,
homepage) AGAINST ('mic*' IN BOOLEAN MODE) );
to match michelle, michael, mick in profiles.

Loading up all of those LIKEs as they stand in the code will not be able to
take advantage of indexes afaik since they start with wildcards.  And I'm
not sure why there are all those %'s in there, maybe I don't fully
understand the syntax of what is going on there.

Questions, comments, further suggestions?

-- 
Mark
"Blessed is he who finds happiness in his own foolishness, for he will
always be happy."
_______________________________________________
Laconica-dev mailing list
[email protected]
http://mail.laconi.ca/mailman/listinfo/laconica-dev

Reply via email to