On Tue, May 15, 2007 at 09:08:06PM +0200, Jacob Robbins wrote: > Jens Kraemer wrote: > > On Tue, May 15, 2007 at 05:37:19PM +0200, Jacob Robbins wrote: > >> rails convention of creating a new active record object to store user > >> query params. I'd like to make a regular rails form using a blank object > >> and then call more_like_this on that object to do a search. > > > > This isn't supported by aaf but should be possible to do with a bit of > > hacking :) > > > > It'll get a bit harder if you want to do this with the DRb server, since > > then you'll have to transfer your unsaved record over to the server for > > the more_like_this query to be built. Atm only id and class name > > are transferred with method calls. > > > > Jens > > Thanks for checking into this Jens, i've done what i wanted by adding an > instance method to aaf. In instance_methods.rb, right after the to_doc > method, i added a to_ferret_query method. This avoids transfering the > whole object when using the DRb server. Tell me what you think...
Perfectly fine if it works for you. Aaf's more_like_this is more complicated, mainly because it tries to find out the 15 or so most relevant terms of your record's content to construct the query to support large documents (and it can even boost these single terms according to their relevance). I'll look into refactoring aaf a bit so that in future versions more_like_this can be used on unsaved records, too. Jens -- Jens Krämer webit! Gesellschaft für neue Medien mbH Schnorrstraße 76 | 01069 Dresden Telefon +49 351 46766-0 | Telefax +49 351 46766-66 [EMAIL PROTECTED] | www.webit.de Amtsgericht Dresden | HRB 15422 GF Sven Haubold, Hagen Malessa _______________________________________________ Ferret-talk mailing list [email protected] http://rubyforge.org/mailman/listinfo/ferret-talk

