On Mon, Mar 30, 2009 at 10:41 PM, Kenneth Kalmer <[email protected]> wrote: > Hi John & the list > > Some background quickly: ruote-rest & ruote 0.9.20 using ActiveParticipant > (without compacted fields). > > I'm sitting with the need to search through workitem fields where the > 'vclass' is a Hash, but the 'yvalue' is a string and can be matched using a > LIKE operator (in MySQL at least). I'm looking to extract all workitems that > contain the said field using a Workitem.search (via /workitems?q=foo). > > I can patch if this behaviour would be acceptable, but I'm not in any > position to comment on the feasibility of the change or how it would affect > other users. Maybe an additional Workitem.search_fields method can be > implemented so it doesn't interfere with the existing behaviour? > > I think I'll start taking on the latter in any case (seeing I'd like this > functionality in ruote-kit).
Hi Kenneth, I [maybe] made a step in that direction : http://github.com/jmettraux/ruote/blob/3f617ef8c0179e53eec28381d58fe5f74b05a4bb/lib/openwfe/extras/participants/ar_participants.rb#L56 This is the latest ar_participants.rb, it's used by ruote-web2. It has this 'keywords' column that summarizes the workitem payload for easier searching : http://gist.github.com/87798 http://github.com/jmettraux/ruote/blob/3f617ef8c0179e53eec28381d58fe5f74b05a4bb/lib/openwfe/extras/participants/ar_participants.rb#L208-230 There is one drawback, since a payload can grow big, it's using the "text" type which (as of MySQL) cannot be indexed :( Since I had issues with ActiveRecord working out of the vanilla Rails request cycle and two tables (workitems + fields), I made this new ar_participant single table. The keywords column summarizes the payload for easier search. Hope this will help. Best regards, -- John Mettraux - http://jmettraux.wordpress.com --~--~---------~--~----~------------~-------~--~----~ you received this message because you are subscribed to the "ruote users" group. to post : send email to [email protected] to unsubscribe : send email to [email protected] more options : http://groups.google.com/group/openwferu-users?hl=en -~----------~----~----~----~------~----~------~--~---
