CakeDC/search — pull request #31 by dereuromark (2011-12-11 12:49:06+00:00)
Title: 2.0

I enhanced the LIKE queries.
Adding % Before/After can be adjusted.
Furthermore, it now treats % and _ as normal chars (instead of another wildcard inside the wildcard string. You can also use now custom wildcards (* is default for any, ? for one). * and ? are the default wildcard on most OS, anyway.
Redundancy between model and controller search configuration is reducible using named/string keys.
using query and formatLike is similar to LIKE

important:
encode/decode fix - there a quite a few open questions and google entries to this topic (e.g. http://groups.google.com/group/cake-php/browse_thread/thread/998a5695427c539a/b1ab28ae525c95fa?lnk=gst&q=search+plugin#b1ab28ae525c95fa). I finally fixed the issue:
/ and = are encoded at the wrong place!). this would only alter the search string which is not an expected result).
since / = and + are part of base64encode they need to be replaced AFTER encoding the string. since + is a valid url char, only / and = have to be replaced and the full char range is supported for queries.

minor warning throwing fixes.

also allowing multiple fields per "like", fixing tests (broken if prefix is used!!!), adding more tests