On Tue, Sep 19, 2006 at 08:50:29AM +0200, David Sheldon wrote: > Jens Kraemer wrote: > > instead copy'n paste you could just call super: > > > > def to_doc > > doc = super > > # custom code here > > doc > > end > > Ah, I had missed out on that, I don't really understand how super works > in ruby. I had been trying to rename the method and create a new one > aliased to it which didn't work. I'm still a bit confused as to_doc is > created by the mixin as an instance method, is there still a superclass > version? Anyway thanks for that tip, I'll try it.
ah, good point. But this should still work if you do the override after calling acts_as_ferret. > > changing the characteristics of a field for a special document doesn't > > seem to be possible any more. Was that what you did until now, i.e. > > tokenize or store a field's value sometimes, and sometimes not ? > > Yes. Some are strings (tokenize), some are integers (dont tokenize, > ideally use a different analyser), and some are choices from lists > (either untokenized String or treat as integer index of choice). Dates > are treated as integers, and we may want to include some strings in the > DB so they can be displayed in the search results. difficult. you could declare one field per type of data (in terms of indexed/stored) you possibly run into, and in your to_doc then decide which data has to go into which field. doesn't sound really nice to mee, but might work. For searching you would then always have to search all these fields, of yourse. Jens -- webit! Gesellschaft für neue Medien mbH www.webit.de Dipl.-Wirtschaftsingenieur Jens Krämer [EMAIL PROTECTED] Schnorrstraße 76 Tel +49 351 46766 0 D-01069 Dresden Fax +49 351 46766 66 _______________________________________________ Ferret-talk mailing list [email protected] http://rubyforge.org/mailman/listinfo/ferret-talk

