On Dec 15, 2004, at 11:16 AM, Colin Guthrie wrote:
For what it's worth, this is quite a generic interface, so I think it would be worth while to try to incorporate a generic implementation into libmyth rather than poking specifically with just mythmusic. Anyone agree??Absolutely. I'd love to be able to search like this instead of sloughing through hundreds of shows.
It is fairly safe to say that this will run of the DB (by that I mean the search terms are in a db field) and use the built in REGEXP stuff in MySQL. If so, the libmyth class or whatever it turns out to be could accept some form of SQL input perhaps?Yes, PostgreSQL does have a regexp search. You use the ~* operator to do a case-insensitive match. So, for example, you'd use this similar SQL to what was shown earlier.
Also, there are quite a few patches just now to allow multiple database backends, so although MySQL has REGEXP, do you know what e.g. the postgresql equiv. is? I've not used postgres much so don't really know but it should be a consideration!
SELECT DISTINCT title FROM program WHERE title ~* '[2abc][5jkl][4ghi][2abc]';
It might also make sense to clamp that to the front of the string in the regex for searching tv shows, or maybe have an option to switch between unrestricted and start of phrase?
Ashley
_______________________________________________ mythtv-dev mailing list [EMAIL PROTECTED] http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
